Solved

Powershell script to automate unlock user account

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
The viewer will learn how to count occurrences of each item in an array.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

752 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