UsrMgr_SetLocalUserProperties
Description
Section titled “Description”Sets or changes the account properties of a local user. The function fails if the user doesn’t exist.
Syntax
Section titled “Syntax”UsrMgr_SetLocalUserProperties(sUserName, bNoPasswordChange, bNoPasswordExpire, bChangePasswordAtNextLogin, sAccountExpireDate, sLoginScript) As Boolean
Parameters
Section titled “Parameters”sUserName (String)
Section titled “sUserName (String)”The name of the local user. The user must exist.
bNoPasswordChange (Boolean)
Section titled “bNoPasswordChange (Boolean)”True sets User cannot change password. False clears it.
bNoPasswordExpire (Boolean)
Section titled “bNoPasswordExpire (Boolean)”True sets Password never expires. False clears it.
bChangePasswordAtNextLogin (Boolean)
Section titled “bChangePasswordAtNextLogin (Boolean)”True sets User must change password at next logon. False clears it.
sAccountExpireDate (String)
Section titled “sAccountExpireDate (String)”The date the account expires. Specify a valid date in the future, or Never if the account should never expire.
sLoginScript (String)
Section titled “sLoginScript (String)”The logon script the user runs. If you specify an empty string, the existing logon script isn’t changed.
Example
Section titled “Example”'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 exampleIf bStatus Then bStatus = UsrMgr_SetLocalUserProperties("Username", True, True, False, DateAdd("yyyy", 5, Now), "")Related functions
Section titled “Related functions”UsrMgr_ChangePassword UsrMgr_DisableLocalUserAccount UsrMgr_CreateLocalGroup UsrMgr_AddUserToLocalGroup Constants Package Property Variables