Blog Stats
  • Posts - 75
  • Articles - 1
  • Comments - 69
  • Trackbacks - 0

 

Powershell: If statements dependent on installed exchange role

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 {
    }

   

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 
 

 

 

Copyright © marc dekeyser