Discussion Locked

Unlock User Account

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Anyone know of a command line tool in the res kit, or elsewhere off the top of their heads that, when run, will unlock a user account?
The situation is we are trying to create a Task Pad through mmc that will allow a group to Reset Passwords, and Unlock Locked accounts, ONLY. Problem is, that the options under menu commands includes only a few items, like Reset Password, but NOT Unlock Account. So if we create one that uses a command, rather than a menu item, I need a commandline tool that cando this... any ideas?

3 replies

by swill57

First, I don't know of any command line executeables that will do this, but I know you can do this from the command line through the ADSI via VBScript.

Some code snippets. You need to have the latest WSH code on you server:

'Querying the Account Disabled Status Flag Using
'a VBScript Active Server Page

Dim User
Dim UserName
Dim UserDomain
UserDomain = "Target_User_Domain"
UserName = "Target_User_Name"
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
Response.Write User.AccountDisabled

'Setting a New Value for the Account Disabled
'Status Flag Using a VBScript Active Server Page

Dim User
Dim UserName
Dim UserDomain
UserDomain = "Target_User_Domain"
UserName = "Target_User_Name"
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
User.AccountDisabled = True
User.SetInfo

Second, I assume you know about these:

How to Grant Help Desk the Specific Right to Unlock Locked User [Q279723]

How To Delegate the Unlock Account Right [Q294952]

Hope this helps.

This discussion is closed to new replies.