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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display AD account lock out and change password

Status
Not open for further replies.

bdragun

MIS
Jan 28, 2003
30
US
I am new to WSH and VBScript. Here is the situation. Users call the help desk about password issues and being locked out. I would like to write a script(inputing the username of course) that when run will display if the user account is locked out in active directory. If so give the option to unlock it, and change the password if necessary. Is this at all possible?? Any help is greatly apprectated.
 
u need to use adsi.
its is tricky due to some Dc being upto date and others not, simple version would be

Set User = GetObject("WinNT://" & userdomain & "/" & username & ",user")
If User.IsAccountLocked = True Then
User.IsAccountLocked = False
User.SetInfo
End If


substitue for domain and username and there you have it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top