I'm trying to go through the Active Directory, and grab users who meet a certain criteria. I want to get users have either Manager A or Manager B, but I'm not sure how to implement the or statement. Here's my code:
Get-ADUser -Filter * -Properties country, extensionattribute9 | if (extensionattribute9 -eq 'Smith, Joe') or (extensionattribute9 -eq 'Doe, John') {select extensionsattribute9, country}
In this code, it doesn't recognize extensionattribute9
, which gives you the user's manager.
I also tried attempted using where
instead of if
, but to no avail.