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
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_load_ad_management_library | Locate and source the shared Active Directory management helpers. | — | — |
_admg_require_dc | Require a usable Active Directory domain controller before a management action. | — | — |
_admg_validate_sam_name | Validate the account name against the accepted sAMAccountName character rules. | — | — |
_admg_list_users_raw | Return current AD user sAMAccountNames in stable display order. | — | Writes one user per line. |
_admg_list_groups_raw | Return current AD group names in stable display order. | — | Writes one group per line. |
_admg_list_computers_raw | Return current AD computer account names in stable display order. | — | Writes one computer per line. |
_admg_select_user | Enumerate users and store one selected user in the requested variable. | - $1 — Output variable name. | — |
_admg_select_group | Enumerate groups and store one selected group in the requested variable. | - $1 — Output variable name. | — |
_admg_select_computer | Enumerate computer accounts and store one selected computer in the requested variable. | - $1 — Output variable name. | — |
_admg_user_is_disabled | Read userAccountControl and test the ACCOUNTDISABLE flag. | - $1 — User sAMAccountName. | — |
_admg_add_member_to_group | Provide the shared implementation used by user- and group-oriented workflows. | - $1 — Group name. | — |
_admg_remove_member_from_group | Provide the shared removal implementation used by user- and group-oriented workflows. | - $1 — Group name. | — |
_admg_user_is_protected | Prevent accidental deletion or disabling of core Samba AD service accounts. | — | — |
_admg_group_is_protected | Prevent accidental deletion of core domain and built-in security groups. | — | — |
_admg_decision_is_quit | Test whether a canonical decision means quit/back. | — | — |
_admg_ask_selection | Render AD selections with manager-owned presentation. | - $2: Name of the output shell variable. | — |
_admg_status | Display realm, controller, service state, and directory object counts. | — | — |
_admg_validate | Validate local Active Directory administration readiness. | — | — |
_admg_list_users | Display all directory user accounts. | — | — |
_admg_show_user | Display the selected user object, account state, and direct group memberships. | — | — |
_admg_create_user | Create directory users, optionally disable password expiry, and optionally continue creating users. | — | — |
_admg_toggle_user | Toggle the selected account between enabled and disabled states. | — | — |
_admg_reset_user_password | Reset the selected user's password using samba-tool's interactive secure prompt. | — | — |
_admg_set_user_password_noexpiry | Disable password expiry for the selected Active Directory user. | — | — |
_admg_delete_user | Delete a selected non-protected user account after confirmation. | — | — |
_admg_user_add_groups | Select a user and one or more groups, then add that user through the shared membership helper. | — | — |
_admg_user_remove_groups | Select from the user's current direct groups and remove selected memberships. | — | — |
_admg_list_groups | Display all directory groups. | — | — |
_admg_show_group | Display the selected group object and its direct members. | — | — |
_admg_create_group | Create a new AD group after confirmation. | — | — |
_admg_delete_group | Delete a selected non-protected AD group after confirmation. | — | — |
_admg_group_add_users | Select a group and users, then add memberships through the shared helper. | — | — |
_admg_group_remove_members | Select a group and remove one or more of its current direct members. | — | — |
_admg_list_computers | Display all directory computer accounts. | — | — |
_admg_show_computer | Display the selected computer AD object. | — | — |
_admg_delete_computer | Remove a selected stale computer account after confirmation. | — | — |
_admg_action_is_mutating | Identify AD management actions that change users, groups or computers. | — | — |
_admg_run_action | Forward 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).
