Ok, here's what I'm trying to do. I'm attempting to pull a list of all disabled users from AD. I've got the script working but I'm having issues trimming down exactly what I need.
Here's my script:
Search-ADAccount -AccountDisabled -UsersOnly | FT Name,SamAccountName -A
I'd like to trim this down to just show me the user ID. I don't care about the name because I'm going to be taking the user IDs and pumping them into another application. When I try to run this:
Search-ADAccount -AccountDisabled -UsersOnly | SamAccountName -A
the command fails.
Any ideas? And, yes I'm doing this in PowerShell for a reason.