<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx</link><description>Summary : Use a one-line Windows PowerShell command to find and unlock user accounts.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3542779</link><pubDate>Thu, 27 Dec 2012 16:03:12 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3542779</guid><dc:creator>Paul Parker</dc:creator><description>&lt;p&gt;Ed,&lt;/p&gt;
&lt;p&gt;The most useful part of the old EventCombMT tools for me was finding the offensive system where the user account was locked. Frequently users &amp;quot;forget&amp;quot; that they are still logged on and disconnected from a remote system, and a recent password change causes accounts to lock due to Kerb Pre-Auth failures. Is there a new tool, or some scripts that will serve a similar purpose as EventComb did? It gets rough (looking through logs) with tens of thousands of users, and hundreds of DCs.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3542779" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3535705</link><pubDate>Fri, 30 Nov 2012 14:14:34 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3535705</guid><dc:creator>robincm2</dc:creator><description>&lt;p&gt;OK, seems as though just adding -server &amp;lt;domain controller&amp;gt; does work, and I do only have one locked account - the one I was expecting to see had just unlocked itself!&lt;/p&gt;
&lt;p&gt;Would still be nice to be able to check a specific user easily though.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3535705" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3535703</link><pubDate>Fri, 30 Nov 2012 13:58:05 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3535703</guid><dc:creator>robincm2</dc:creator><description>&lt;p&gt;I&amp;#39;m also not getting any output with search-adaccount -lockedout&lt;/p&gt;
&lt;p&gt;Unless I add -server &amp;lt;domain controller&amp;gt;&lt;/p&gt;
&lt;p&gt;then I get one user listed but I&amp;#39;m pretty sure there are others locked out too.&lt;/p&gt;
&lt;p&gt;This is from within the powershell 3.0 ISE.&lt;/p&gt;
&lt;p&gt;Also, get-aduser -identity &amp;lt;username&amp;gt; doesn;t tell you if the account is locked out or not, which is less than helpful in this situation. I assume there is a way to check if a specific user is locked out?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3535703" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3517289</link><pubDate>Fri, 31 Aug 2012 09:00:07 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3517289</guid><dc:creator>Lefty</dc:creator><description>&lt;p&gt;Hello all,&lt;/p&gt;
&lt;p&gt;This cmdlet does not work in our domain. I have a 2008 R2 AD, 3 DC&amp;#39;s, single domain, all GC&amp;#39;s.&lt;/p&gt;
&lt;p&gt;I do start PowerShell with AD (Run as Admin, elevated) and run Search-ADAccount locally on DC. &lt;/p&gt;
&lt;p&gt;LockedOut. Cmdlet runs but does not give any output, just a blank line.&lt;/p&gt;
&lt;p&gt;LockoutStatus.exe and Saved Query in ADUC finds all three locked out users in the domain from same DC.&lt;/p&gt;
&lt;p&gt;ADUC saved query: &amp;nbsp;(&amp;amp;(&amp;amp;(&amp;amp;(objectCategory=Person)(objectClass=User)(lockoutTime&amp;gt;=1))))&lt;/p&gt;
&lt;p&gt;Also, I tried to manually start powershell and import ad module. Same.&lt;/p&gt;
&lt;p&gt;Any thoughts?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3517289" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3450885</link><pubDate>Fri, 02 Sep 2011 16:46:40 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450885</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@PsGuruNot, I am sorry you have been having problems. Please refer to the TWO articles that I mention at the very beginning of this article. This article is actually the third in a series. I am copying the NOTE: from the beginning of the article. Unfortunately, the hyperlinks will be removed. &lt;/p&gt;
&lt;p&gt;Note &amp;nbsp; This is the third in a series of three posts about working with the ActiveDirectory module. In the first post, I discussed the RSAT tools and the Get-ADUser cmdlet. In the second post, I talked about installing the Active Directory management web service. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450885" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3450883</link><pubDate>Fri, 02 Sep 2011 16:44:42 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450883</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@Ed Price, you are welcome. &lt;/p&gt;
&lt;p&gt;@Klaus Schulte, one can only hope. &lt;/p&gt;
&lt;p&gt;@BATCHman, I am glad you found it useful.&lt;/p&gt;
&lt;p&gt;@Jens, that is, of course, an option. Here, I wanted to stay with the same tool I had been using, and to show there is always the possibility of using RUNAs.&lt;/p&gt;
&lt;p&gt;@Bartek, that is a great suggestion, and one I had not thought of using. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450883" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3450864</link><pubDate>Fri, 02 Sep 2011 14:30:25 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450864</guid><dc:creator>PSguruNot</dc:creator><description>&lt;p&gt;I want to learn PS but every time I enter a command, I get an error. Ex:&lt;/p&gt;
&lt;p&gt;PS C:\Users\Administrator&amp;gt; Import-Module activedirectory&lt;/p&gt;
&lt;p&gt;The term &amp;#39;Import-Module&amp;#39; is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.&lt;/p&gt;
&lt;p&gt;At line:1 char:14&lt;/p&gt;
&lt;p&gt;+ Import-Module &amp;nbsp;&amp;lt;&amp;lt;&amp;lt;&amp;lt; activedirectory&lt;/p&gt;
&lt;p&gt;I have spent hours trying to understand how to add the necessary pieces to make this work but I have come up short. I am running this on Server2008 R2. Can anyone show me the light and give me a generous push in the right direction. I would be so appreciative to be able to start using the PS tools.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450864" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3450820</link><pubDate>Fri, 02 Sep 2011 09:59:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450820</guid><dc:creator>Bartek Bielawski</dc:creator><description>&lt;p&gt;I would suggest to use PSDrives here, to have different credentials/ domains connected. Simple exampe:&lt;/p&gt;
&lt;p&gt;PS AD:\&amp;gt; $Options = @{&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; PSProvider = &amp;#39;ActiveDirectory&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; Name = &amp;#39;NWT&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; Root = &amp;#39;nwtraders.msft&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; FormatType = &amp;#39;canonical&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; Server = &amp;#39;192.168.0.1&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; Credential = (Get-Credential nwtraders\bielawb)&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt; }&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;New-PsDrive @Options&lt;/p&gt;
&lt;p&gt;PS AD:\&amp;gt; Get-ADDomain | select -ExpandProperty name&lt;/p&gt;
&lt;p&gt;eu&lt;/p&gt;
&lt;p&gt;PS AD:\&amp;gt; cd nwt:&lt;/p&gt;
&lt;p&gt;PS NWT:\&amp;gt; Get-ADDomain | select -ExpandProperty name&lt;/p&gt;
&lt;p&gt;nwtraders&lt;/p&gt;
&lt;p&gt;Once I CD to different folder - I&amp;#39;m connected to different domain, or the same domain, but with a different set of credentials. All command from module will follow.&lt;/p&gt;
&lt;p&gt;HTH! :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450820" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3450611</link><pubDate>Thu, 01 Sep 2011 13:41:43 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450611</guid><dc:creator>Jens Gyldenkærne Clausen</dc:creator><description>&lt;p&gt;Instead of starting a powershell instance using &amp;quot;Run as a different user&amp;quot; I would suggest to use the -Credential parameter of Unlock-ADAccount: &lt;/p&gt;
&lt;p&gt;Unlock-ADAccount -Credential (Get-Credential myAdminUser)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450611" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Find Locked-Out User Accounts</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/31/use-powershell-to-find-locked-out-user-accounts.aspx#3450437</link><pubDate>Wed, 31 Aug 2011 18:09:15 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3450437</guid><dc:creator>BATCHman</dc:creator><description>&lt;p&gt;Helped me out the other day, when Cmdlet made the mistake of locking himself out in the BATCHcave :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3450437" width="1" height="1"&gt;</description></item></channel></rss>