Find object properties containing a certain value

Tagged: 

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

  • Author
    Posts
  • #68499

    DirtyBeets
    Participant

    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
    Participant

    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

You must be logged in to reply to this topic.