Powershell: If statements dependent on installed exchange role

Posted by marc dekeyser on Geeks with Blogs See other posts from Geeks with Blogs or by marc dekeyser
Published on Wed, 05 Dec 2012 12:59:44 GMT Indexed on 2012/12/05 17:05 UTC
Read the original article Hit count: 263

Filed under:
Something I need to keep for usage in the future:

$hostname=hostname
If (get-exchangeserver $hostname | where {$_.isClientAccessServer -eq $true})
    {
    } else {
    }
   
If (get-exchangeserver $hostname | where {$_.isHubTransportServer -eq $true})
    {
    } else {
    }

If (get-exchangeserver $hostname | where {$_.isMailboxServer -eq $true})
    {
    } else {
    }

If (get-exchangeserver $hostname | where {$_.isUnifiedMessagingServer -eq $true})
    {
    } else {
    }

If (get-exchangeserver $hostname | where {$_.isEdgeServer -eq $true})
    {
    } else {
    }

   

© Geeks with Blogs or respective owner