Solved

Powershell script to automate unlock user account

Posted on 2014-02-13
2
6,084 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 40

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

713 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