Skip to content

Instantly share code, notes, and snippets.

@amandadebler
Last active June 3, 2016 10:00
Show Gist options
  • Save amandadebler/353b6306822cff7709475c05d35e1985 to your computer and use it in GitHub Desktop.
Save amandadebler/353b6306822cff7709475c05d35e1985 to your computer and use it in GitHub Desktop.
Snippets to get a list of computers by role in Skype for Business/Lync topology
$SBAs = (Get-CsPool).where({$_.services -like "*registrar*" -and $_.services.where({$_ -like "WebServer*"}).count -eq 0}).computers
$frontEndServers = (Get-CsPool).where({$_.services -like "*registrar*" -and $_.services -like "Conferencing*"}).computers
$directorServers = (Get-CsPool).where({$_.services -like "*registrar*" -and $_.services -like "WebServer*" -and $_.services.where({$_ -like "Conferencing*"}).count -eq 0}).computers
$mediationServers = (Get-CsPool).where({$_.services -like "*Mediation*" -and $_.services.where({$_ -like "registrar*"}).count -eq 0}).computers
$edgeServers = (Get-CsPool).where({$_.services -like "*Edge*"}).computers
# Limitation: does not explore the Office Web Apps Farm for individual servers
$OfficeWebAppServers = (Get-cspool).where({$_.services -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({$_.services -like "PstnGateway*"}).computers.where({ Resolve-DnsName $_ -ErrorAction SilentlyContinue })
#Excludes Standard Edition servers hosting their own FileStores
$fileStores = (get-cspool).where({$_.services -like "FileStore*" -and $_.services.where({$_ -like "registrar*"}).count -eq 0}).computers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment