Thread: VB script
View Single Post
Old 04-22-2005, 08:35 AM   #1 (permalink)
Odoggy5
Code Monkey
 
Odoggy5's Avatar
 
Join Date: Aug 2003
Location: SF
Posts: 47
Odoggy5 is on a distinguished road
Send a message via AIM to Odoggy5
VB script

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
Odoggy5 is offline   Reply With Quote