I want to search all the properties of an Active Directory user for a particular phone number/extension.
I can get all the properties like so:
get-aduser joesmith -Properties *
but I want to filter the results for, say extension 1234 (which may be in many places, like extensionAttribute1, OfficePhone, HomePhone, Mobile, etc).
I tried:
get-aduser joesmith -Properties * | where-object {$_ -like "*1234*" }
but where-object wants $_.value, and I don't know the precise value.
How should I search the values for multiple properties? I'd like to see results like:
mobile 1234
officephone 12345
othermobile 61234