UsrMgr_SetLocalUserProperties
Description
Sets or changes a users account properties.
Syntax
UsrMgr_SetLocalUserProperties(sUserName, bNoPasswordChange, bNoPasswordExpire, bChangePasswordAtNextLogin, sAccountExpireDate, sLoginScript) As Boolean
Parameters
sUserName (String)
The name of the user, the user must exist
bNoPasswordChange (Boolean)
Set or unset User cannot change password
bNoPasswordExpire (Boolean)
Set or unset Password never expires
bChangePasswordAt (Boolean)
The user has to change the password at next login
sAccountExpireDate (String)
The date the account expires. The sAccountExpireDate should be a valid date in the future. Specify 'Never' if the account should never expire
sLoginScript (String)
Specifies the login script the user should execute
Example
VBScript
'Sample 1: If bStatus Then bStatus = UsrMgr_SetLocalUserProperties("Username", False, False, True, "Never", "Login.cis") 'Sample 2: Note - DateAdd adds 5 years to current date in this example If bStatus Then bStatus = UsrMgr_SetLocalUserProperties("Username", True, True, False, DateAdd("yyyy", 5, Now), "")