Created
November 24, 2018 15:19
-
-
Save jheinrichs79/496603121c6cc66ecfdc93b2c85355cb to your computer and use it in GitHub Desktop.
Powershell - Domain Lockout Troubleshooter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Quickly get the lockouts of Domain accounts | |
.DESCRIPTION | |
This script will show you the number of lockout of "X" amount of day. | |
It helps to easily track down lockout account issue and | |
.NOTES | |
Version: 1.0 | |
Author: Jared Heinrichs | |
Creation Date: 11/22/2018 | |
Purpose/Change: Initial script development | |
.EXAMPLE | |
Using the command "Get-ADDomain, you can easily get the PDCEmulator info. | |
Once you have that you can then fill out the pre-defined items. | |
#> | |
Get-ADDomain | |
#Pre-defined items | |
#====================================================================================== | |
$PDCEmulator = "PDCEmulator-Name.domain.local" | |
$Days = "7" | |
$filterHashtable = @{logname='security';id=4740;starttime=(get-date).AddDays(-$Days)} | |
$userName = @{label='username';expression={$_.properties[0].value}} | |
$computerName = @{label='computername';expression={$_.properties[1].value}} | |
#====================================================================================== | |
Get-WinEvent -ComputerName $PDCEmulator -FilterHashtable $filterHashtable | select-object -Property timecreated,$userName,$computerName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment