currently I'm creating a script that will at the moment just return a message if an Account is not locked out, and .LockedOut = "False". All the accounts i'm running have False as their LockedOut status, however it's not returning the message in my if statement like I would hope.
$user1 = $env:USERNAME
$u = Import-Csv C:\Users\$user1\Documents\ServiceAccts.csv | ForEach-Object{ Get-ADUser $_.User -Properties *}
#Run write-output to display AD info
#write-output $u
if ($u.LockedOut -eq "False") {[System.Windows.MessageBox]::Show('Not Locked')}
So I'm just hoping that for each one that equals false for it to display the message box at the moment. I was hoping you guys could help me out and see if anything is wrong with my If statement. Thanks!