Solved

Powershell script to automate unlock user account

Posted on 2014-02-13
2
5,584 Views
Last Modified: 2014-02-15
Hello All,

I am looking for a powershell script that will let me automate and unlock of particular accounts.

For some reason they are some accounts getting locked everyday and I am thinking to implement this script as a schedule task until I resolve the issue. This task will run on one of my DC.

Any hint where to find one?
0
Comment
Question by:LuiLui77
2 Comments
 
LVL 39

Assisted Solution

by:footech
footech earned 225 total points
ID: 39858167
I don't know if you would really want to implement this, but the following would unlock all locked out accounts.
Search-ADAccount -LockedOut | Unlock-ADAccount

Open in new window

The lock out events should tell you which machine an account is locked out on.  Anyway, assuming you don't want to unlock all accounts, you can filter the results from Search-ADAccount before piping it to Unlock-ADAccount.  For example:
Search-ADAccount -LockedOut | Where {$_.samaccountname -eq "jdoe"} | Unlock-ADAccount

Open in new window

0
 
LVL 4

Accepted Solution

by:
michaelalphi earned 275 total points
ID: 39858777
To unlock specific user account : Unlock-QADUser DSotnikov
Also, you can check this Account unlock and management tool to troubleshoot account lockouts, as well as add functionality to Active Directory.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

24 Experts available now in Live!

Get 1:1 Help Now