Author Posts

April 11, 2017 at 3:08 pm

I've been trying to work out how I and loop through all of an object's items to see if they contain a certain value.
For example I want to see if an incorrect email address is in any of an exchange mailbox's properties.

April 12, 2017 at 4:34 pm

You can try something like ths

$users = Get-mailbox
foreach ($user in $users){
foreach ($property in $user.propertyNames) {
#now you can get a handle on each object and process it as needed
$user.$($property)
} #End For Each Property
}#End For Each User