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

Part of samba.netcmd.user View In Hierarchy

Sets the expiration of a user account

This command sets the expiration of a user account. The username specified on the command is the sAMAccountName. The username may also be specified using the --filter option.

When a user account expires, it becomes disabled and the user is unable to logon. The administrator may issue the samba-tool user enable command to enable the account for logon. The permissions and memberships associated with the account are retained when the account is enabled.

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 on a remote server.

Example1: samba-tool user setexpiry User1 --days=20 --URL=ldap://samba.samdom.example.com --username=administrator --password=passw1rd

Example1 shows how to set the expiration of an account in a remote LDAP server. The --URL parameter is used to specify the remote target server. The --username= and --password= options are used to pass the username and password of a user that exists on the remote server and is authorized to update that server.

Exampl2: su samba-tool user setexpiry User2

Example2 shows how to set the account expiration of user User2 so it will never expire. The user in this example resides on the local server. sudo is used so a user may run the command as root.

Example3: samba-tool user setexpiry --days=20 --filter=samaccountname=User3

Example3 shows how to set the account expiration date to end of day 20 days from the current day. The username or sAMAccountName is specified using the --filter= paramter and the username in this example is User3.

Example4: samba-tool user setexpiry --noexpiry User4 Example4 shows how to set the account expiration so that it will never expire. The username and sAMAccountName in this example is User4.

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=None, sambaopts=None, credopts=None, versionopts=None, H=None, filter=None, days=None, noexpiry=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.