s.n.u.cmd_user_create(Command) : class documentation

Part of samba.netcmd.user View In Hierarchy

Known subclasses: samba.netcmd.user.cmd_user_add

Creates a new user

This command creates a new user account in the Active Directory domain. The username specified on the command is the sAMaccountName.

User accounts may represent physical entities, such as people or may be used as service accounts for applications. User accounts are also referred to as security principals and are assigned a security identifier (SID).

A user account enables a user to logon to a computer and domain with an identity that can be authenticated. To maximize security, each user should have their own unique user account and password. A user's access to domain resources is based on permissions assigned to the user account.

The command may be run from the root userid or another authorized userid. The -H or --URL= option can be used to execute the command against a remote server.

Example1: samba-tool user add User1 passw0rd --given-name=John --surname=Smith --must-change-at-next-login -H ldap://samba.samdom.example.com -Uadministrator%passw1rd

Example1 shows how to create a new user in the domain against a remote LDAP server. The -H parameter is used to specify the remote target server. The -U option is used to pass the userid and password authorized to issue the command remotely.

Example2: sudo samba-tool user add User2 passw2rd --given-name=Jane --surname=Doe --must-change-at-next-login

Example2 shows how to create a new user in the domain against the local server. sudo is used so a user may run the command as root. In this example, after User2 is created, he/she will be forced to change their password when they logon.

Example3: samba-tool user add User3 passw3rd --userou=OrgUnit

Example3 shows how to create a new user in the OrgUnit organizational unit.

Method run Run the command. This should be overriden by all subclasses.

Inherited from Command:

Method __init__ Undocumented
Method usage Undocumented
Method show_command_error display a command error
Method message Undocumented
Method get_logger Get a logger object.
Method _get_short_description Undocumented
Method _get_full_description Undocumented
Method _get_name Undocumented
Method _create_parser Undocumented
Method _run Undocumented
def run(self, username, password=None, credopts=None, sambaopts=None, versionopts=None, H=None, must_change_at_next_login=False, random_password=False, use_username_as_cn=False, userou=None, surname=None, given_name=None, initials=None, profile_path=None, script_path=None, home_drive=None, home_directory=None, job_title=None, department=None, company=None, description=None, mail_address=None, internet_address=None, telephone_number=None, physical_delivery_office=None):
Run the command. This should be overriden by all subclasses.
API Documentation for Samba, generated by pydoctor at 2011-12-08 20:23:28.