All,
I am trying to check extensionAttribute1 value for computer accounts in an OU. I am running the following command
$Computer = Get-ADComputer Filter * -Searchbase <OU path> -Properties *
It runs perfectly and I believe all the information is stored in $Computer. But the extensionAttribute1 is not visible under $Computer (using PowerGUI). However there is a property of $Computer named PropertyNames and I can see extensionAttribute1 under there.
Can someone please tell me how I can get this value? I would like to do something like this in the bigger picture
1. Get all properties of all the computers (done using Get-ADComputer) and store it in $Computer
2. For each computer under $Computer, get the value of extensionAttribute1
3. If extensionAttribute is X, do something. If it is not X, do something else.
Thanks.