Solved

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

Posted on 2004-08-26
2
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a guide to the following problem (not exclusive but here) on Windows: Users need our support and we supporters often use global administrative accounts to do this. Using these accounts safely is a real challenge. Any admin who takes se…
OfficeMate Freezes on login or does not load after login credentials are input.
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 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