This is the basic user management for Samba4 Active Directory Domain Controller.
sudo samba-tool user list
returns:
Administrator testuser Guest
sudo samba-tool user create testuser New Password: # set password Retype Password: User 'testuser' created successfully
NOTE: See many other options with:
samba-tool user create --help
sudo samba-tool user delete testuser
returns:
Deleted user testuser
sudo samba-tool user setpassword testuser
New Password:
Changed password OK
sudo samba-tool user setexpiry testuser --days=7 Expiry for user 'testuser' set to 7 days.
sudo samba-tool user disable testuserr sudo samba-tool user enable testuser Enabled user 'testuser'
sudo samba-tool group list
Allowed RODC Password Replication Group
Enterprise Read-Only Domain Controllers
Denied RODC Password Replication Group
...
...
DnsAdmins
Guests
Users
sudo samba-tool group listmembers "Domain Users" Administrator testuser bionic
sudo samba-tool group add ShareWiz
Added group ShareWiz
NOTE: See many other options with:
samba-tool group add --help
sudo samba-tool group delete ShareWiz
Deleted group ShareWiz
sudo samba-tool group addmembers ShareWiz testuser
Added members to group ShareWiz
sudo samba-tool group removemembers ShareWiz testuser
Removed members from group ShareWiz