Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Snippets to get a list of computers by role in Skype for Business/Lync topology
$SBAs = (Get-CsPool).where({$ -like "*registrar*" -and ${$_ -like "WebServer*"}).count -eq 0}).computers
$frontEndServers = (Get-CsPool).where({$ -like "*registrar*" -and $ -like "Conferencing*"}).computers
$directorServers = (Get-CsPool).where({$ -like "*registrar*" -and $ -like "WebServer*" -and ${$_ -like "Conferencing*"}).count -eq 0}).computers
$mediationServers = (Get-CsPool).where({$ -like "*Mediation*" -and ${$_ -like "registrar*"}).count -eq 0}).computers
$edgeServers = (Get-CsPool).where({$ -like "*Edge*"}).computers
# Limitation: does not explore the Office Web Apps Farm for individual servers
$OfficeWebAppServers = (Get-cspool).where({$ -like "*WacServer*"}).computers
# Filters out backup PSTN trunks to pair gateways with secondard Mediation Services - only shows PSTN trunks with "real" FQDNs
$PSTNGateways = (Get-CsPool).where({$ -like "PstnGateway*"}).computers.where({ Resolve-DnsName $_ -ErrorAction SilentlyContinue })
#Excludes Standard Edition servers hosting their own FileStores
$fileStores = (get-cspool).where({$ -like "FileStore*" -and ${$_ -like "registrar*"}).count -eq 0}).computers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment