Solved

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

Posted on 2004-08-26
2
163 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
Comment Utility
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
Comment Utility
ThanQ
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In today's information driven age, entrepreneurs have so many great tools and options at their disposal to help turn good ideas into a thriving business. With cloud-based online services, such as Amazon's Web Services (AWS) or Microsoft's Azure, bus…
SHARE your personal details only on a NEED to basis. Take CHARGE and SECURE your IDENTITY. How do I then PROTECT myself and stay in charge of my own Personal details (and) - MY own WAY...
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now