Solved

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

Posted on 2004-08-26
2
165 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flux question 2 115
Adding site to local intranet security. 4 50
Excel files protected mode 4 49
risks in installing microsoft baseline security analyser on live server 3 79
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…
Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

810 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