#skype4b #powershell Get List of Server Roles

Very often in an on-premise or hybrid Skype for Business Server setup, there is a need to get a current list of a particular server role. Rather than hard-coding this information, consider the following approaches:

$site = ‘HK’
$role = ‘*Registrar*’

$site1 = Get-CsPool -site $site
$reg = $site1 | ? Services -like $role

$reg.Identity #pool FQDN
$reg.Computers #machines in each pool

$role = Get-CsService -Registrar | ? PoolFqdn -like “*$site*”
$c = @()
foreach ($spool in $role.PoolFqdn)
$c += Get-CsComputer -Pool $spool

$role.PoolFqdn  #pool FQDN
$c.Identity #pool machines

Leave a Reply