Created
January 8, 2019 12:12
-
-
Save shaneis/020223a2dea0d3e2471c092393a6f141 to your computer and use it in GitHub Desktop.
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
while ((Get-Date) -lt (Get-Date '2019-01-08 17:00:00')) { | |
$JamesLockedAccount = Search-ADAccount -LockedOut | Where-Object Name -eq 'James ReportWriter' | |
if ($JamesLockedAccount) { | |
New-BurntToastNotification -Text 'James is locked out again.' | |
# Since this is a script, I'll manually clean up after myself. | |
Remove-Variable -Name JamesLockedAccount | |
} | |
Write-Host '.' -NoNewLine | |
Start-Sleep -Seconds 180 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment