Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable account expiration with input box

Status
Not open for further replies.

scriptnub

IS-IT--Management
Dec 10, 2008
3
US
We are setting a date for all user accounts to expire on a certain date until they turn in mandatory IA training... im trying to write a script that will allow me to set it to Never under the account expiration by typing the name of the user in an Input Box this is what i have so far but i cant seem to get it to work.

set objShell = wscript.createobject("wscript.shell")

strUserDn= ",OU=Users,OU=t,OU=s,OU=e,OU=t,DC=domain,DC=goes, DC=here"
strUser = Cn=InputBox("Enter User Name:", "Disable Account Experation ")
strExpireDate = "12/18/2008"
set objUser = GetObject("LDAP://" & strUser & strUserDN)
objUser.Put "accountExpires",0
objUser.SetInf

any help or pointers on the right path would be greatly appreciated
 
You have a syntax error here;
strUser = Cn=InputBox("Enter User Name:", "Disable Account Experation
You wanted this ?
strUser = "Cn=" & InputBox("Enter User Name:", "Disable Account Experation

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
so by changing that it would use the username placed in the input box as the one it edited the information on?
 
Dunno, I've just tried to fix your syntax error:
strUser = "Cn=" & InputBox("Enter User Name:", "Disable Account Expiration ")
 
I fixed the syntax error and it still doesnt seem to work... any other ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top