Find object properties containing a certain value

This topic contains 1 reply, has 2 voices, and was last updated by  Tony Bulding 1 year, 2 months ago.

  • Author
  • #68499


    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.

  • #68605

    Tony Bulding

    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
    } #End For Each Property
    }#End For Each User

You must be logged in to reply to this topic.