Powershell Active Directory Account Attribute to a variable
- by Bill Garrett
Sorry for the newbie question. I am using Powershell 3 to get a list of all user accounts. I am trying to generate an output for accounts, either "Enabled" or "Disabled". I am able to get the account status code from active directory using:
$rc = $Rech.PropertiesToLoad.Add("userAccountControl");
That will display the correct account status code.
When I try to use an if statement on the value, I dont get any result. How do I put this value into a variable to use some logic with it?
In the end, my requirements are to have the output to an CSV file that I can send to HR and have them examin it and instead of a code I would like to have it say "Enabled" or "Disabled".
Thank you.