Solved

Unlocking users via program/script that would automate the task.

Posted on 2004-08-26
2
167 Views
Last Modified: 2013-12-04
I am lookin for a software or a program that would change the badpwdcount or the account lock to 0 or true. I would nead an automated task for it (reason generic account and people that can'T type 4 dang letters in less then 10 attempt).


thx
0
Comment
Question by:Fujounou
  • 2
2 Comments
 
LVL 57

Accepted Solution

by:
Pete Long earned 250 total points
ID: 11907040
Unlocking Domain user accounts using scripts

Copy the following into notepad and save it with a .vbs extension.

'-------------------------------------------------------------------------------
' Usr_AccountUnlock.vbs
'
' Developer: Charles (charles@serverguys.com)
' Developed: 2000-08-01
' Modified: 2000-08-01
' Version: 1.0
'
' Description: Uses ADSI to unlock the given account
'-------------------------------------------------------------------------------

'-------------------------------------------------------------------------------
' *** Definitions ***
'-------------------------------------------------------------------------------
dim acct
dim dom
dim UsrObj

'-------------------------------------------------------------------------------
' *** Main Script ***
'-------------------------------------------------------------------------------
' Display an inputbox requesting the account to unlock
acct = inputbox("Please enter the account name.", "Unlock Account")

' Display an inputbox requesting the domain name to look in
dom = inputbox("Please enter the domain name where this account resides.", "Unlock Account")

wscript.echo "Beginning unlock of account " & dom & "\" & acct

Set UsrObj = GetObject("WinNT://" & dom & "/" & acct)
If UsrObj.IsAccountLocked = TRUE Then
   UsrObj.IsAccountLocked = FALSE
   UsrObj.SetInfo
End If

wscript.echo "Completed unlock of account " & dom & "\" & acct

'-------------------------------------------------------------------------------
' *** End Main ***
'-------------------------------------------------------------------------------

Courtesy of http://www.serverguys.com/scripts/winnt.htm
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 11916311
ThanQ
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No security measures warrant 100% as a "silver bullet". The truth is we also cannot assume anything but a defensive and vigilance posture. Adopt no trust by default and reveal in assumption. Only assume anonymity or invisibility in the reverse. Safe…
Article by: btan
The intent is not to repeat what many has know about Ransomware but more to join its dots of what is it, who are the victims, why it exists, when and how we respond on infection. Lastly, sum up in a glance to share such information with more to help…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question