Manage Active Directory

SolidGroundUX DocumentationSolidGroundUX
NL

Manage Samba Active Directory users, groups, memberships, and computers

Source: target-root/usr/local/libexec/solidgroundux/manage-active-directory.sh

Manage Samba Active Directory users, groups, memberships, and computers

Public functions

Internal functions
FunctionPurposeArgumentsOutput
_load_ad_management_libraryLocate and source the shared Active Directory management helpers.——
_admg_require_dcRequire a usable Active Directory domain controller before a management action.——
_admg_validate_sam_nameValidate the account name against the accepted sAMAccountName character rules.——
_admg_list_users_rawReturn current AD user sAMAccountNames in stable display order.—Writes one user per line.
_admg_list_groups_rawReturn current AD group names in stable display order.—Writes one group per line.
_admg_list_computers_rawReturn current AD computer account names in stable display order.—Writes one computer per line.
_admg_select_userEnumerate users and store one selected user in the requested variable.- $1 — Output variable name.—
_admg_select_groupEnumerate groups and store one selected group in the requested variable.- $1 — Output variable name.—
_admg_select_computerEnumerate computer accounts and store one selected computer in the requested variable.- $1 — Output variable name.—
_admg_user_is_disabledRead userAccountControl and test the ACCOUNTDISABLE flag.- $1 — User sAMAccountName.—
_admg_add_member_to_groupProvide the shared implementation used by user- and group-oriented workflows.- $1 — Group name.—
_admg_remove_member_from_groupProvide the shared removal implementation used by user- and group-oriented workflows.- $1 — Group name.—
_admg_user_is_protectedPrevent accidental deletion or disabling of core Samba AD service accounts.——
_admg_group_is_protectedPrevent accidental deletion of core domain and built-in security groups.——
_admg_decision_is_quitTest whether a canonical decision means quit/back.——
_admg_ask_selectionRender AD selections with manager-owned presentation.- $2: Name of the output shell variable.—
_admg_statusDisplay realm, controller, service state, and directory object counts.——
_admg_validateValidate local Active Directory administration readiness.——
_admg_list_usersDisplay all directory user accounts.——
_admg_show_userDisplay the selected user object, account state, and direct group memberships.——
_admg_create_userCreate directory users, optionally disable password expiry, and optionally continue creating users.——
_admg_toggle_userToggle the selected account between enabled and disabled states.——
_admg_reset_user_passwordReset the selected user's password using samba-tool's interactive secure prompt.——
_admg_set_user_password_noexpiryDisable password expiry for the selected Active Directory user.——
_admg_delete_userDelete a selected non-protected user account after confirmation.——
_admg_user_add_groupsSelect a user and one or more groups, then add that user through the shared membership helper.——
_admg_user_remove_groupsSelect from the user's current direct groups and remove selected memberships.——
_admg_list_groupsDisplay all directory groups.——
_admg_show_groupDisplay the selected group object and its direct members.——
_admg_create_groupCreate a new AD group after confirmation.——
_admg_delete_groupDelete a selected non-protected AD group after confirmation.——
_admg_group_add_usersSelect a group and users, then add memberships through the shared helper.——
_admg_group_remove_membersSelect a group and remove one or more of its current direct members.——
_admg_list_computersDisplay all directory computer accounts.——
_admg_show_computerDisplay the selected computer AD object.——
_admg_delete_computerRemove a selected stale computer account after confirmation.——
_admg_action_is_mutatingIdentify AD management actions that change users, groups or computers.——
_admg_run_actionForward an Active Directory management action to its management executable.- $1: Management action to execute.—

Description

Implements day-to-day directory administration exposed by the 27-active-directory-management Management Console module.

Usage

Run the executable from its shell command (or installed wrapper):

manage-active-directory --action status
manage-active-directory --action user-list
manage-active-directory --action group-list

Script-specific options:

  • --action NAME, -a: Management action (supported actions: status, validate, user-list, user-show, user-create, user-toggle, user-password, user-noexpiry, user-addgroups, user-removegroups, user-delete, group-list, group-show, group-create, group-addusers, group-removemembers, group-delete, computer-list, computer-show, computer-delete).