just starting messing with some scripts for AD wondering if somebody could help meout with this one. This script unchecks the password never expires value for a user, how can I do the opposite and put a check mark in that option?
Code:
CONST ADS_UF_DONT_EXPIRE_PASSWD = &h10000
Set objUser = GetObject _
("LDAP://cn=pos2000,ou=pos2000 users,dc=rtd02590,dc=local")
intUAC = objUser.Get("userAccountControl")
If intUAC AND _
ADS_UF_DONT_EXPIRE_PASSWD Then
objUser.Put "userAccountControl", intUAC XOR _
ADS_UF_DONT_EXPIRE_PASSWD
objUser.SetInfo
End If