Local user properties set using scripts

From: Shivaram Siddappa (ShivaramSiddappa_at_discussions.microsoft.com)
Date: 11/26/04


Date: Fri, 26 Nov 2004 08:43:04 -0800

I would like to set local user propeties
*user cannot change password.
*password never expires

I have the below script. What option I should add to set user cannot change
password. It set only password expires.

Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
strComputer = "ABCD"
strUser = "dpiscitelli"
Set objUser = GetObject("WinNT://" & _
                        strComputer & "/" & strUser & ",User")

objUserFlags = objUser.Get("UserFlags")
objPasswordExpirationFlag = objUserFlags OR ADS_UF_DONT_EXPIRE_PASSWD
objUser.Put "userFlags", objPasswordExpirationFlag
objUser.SetInfo

Thanks



Relevant Pages

  • Re: AD password policy in Forms auth against AD
    ... > failed (due to lockout, disabled, expired, user must change password, etc. ... >> password expires ... >> possible with AD, I could set the expiration time to a year, and force ... >> hundred customers, where all customers will be stored in a AD (in their ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: removing the "password never expires" setting from LOCAL user (not Active Directory) a
    ... The code shouldn't set "User must change password at next logon". ... Note that with the LDAP provider, you assign the value 0 to the pwdLastSet ... > This does indeed remove the "Password never expires" option but it ...
    (microsoft.public.scripting.vbscript)
  • Re: password never expires
    ... Set objCommand = CreateObject ... Set objConnection = CreateObject ... > In my requirement i need to uncheck both the> 1) "user cannot change password"> 2) "Password never expires" checkboxes. ...
    (microsoft.public.win2000.active_directory)
  • Re: AD password policy in Forms auth against AD
    ... need a service account that can access the user account to read all of their ... (due to lockout, disabled, expired, user must change password, etc. vs. ... > password expires ... > hundred customers, where all customers will be stored in a AD (in their ...
    (microsoft.public.dotnet.framework.aspnet.security)