Active Directory userAccountControl Values
http://rajnishbhatia19.blogspot.com/2008/11/active-directory-useraccountcontrol.html
'***********************************************************************************
'Script Name: OU_Users_Password_Never_Expires.vbs
'Author: Dean Bunn
'Created: 01/10/11
'Description: Set All Enabled User Accounts in an OU to Password Never Expires
'***********************************************************************************
dim objOU, objUser, intPwdChg
intPwdChg = 66048
objOU="OU=staff,DC=mynetwork,DC=com"
set objOU = GetObject("LDAP://" & objOU)
for each objUser in objOU
if objUser.Class="user" Then
set objUser = GetObject("LDAP://" & objUser.distinguishedName)
if objUser.userAccountControl = 512 OR objUser.userAccountControl = 544 then
objUser.Put "userAccountControl", intPwdChg
objUser.setInfo
end if
end if
next
wscript.echo "All Done"
No comments:
Post a Comment