Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » Adsi

Modify a Local User Account So It Never Expires in Windows

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.

Modify a Local User Account So It Never Expires in Windows using VBScript, WMI and LDAP

Example(s)

Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000

strComputer = "atl-win2k-01"
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer")

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