Home > Lync Server/Skype for Business Server > One Liners: Finding Out Which Lync Pool Servers a User is Associated With, and the Preferred Connection Order

One Liners: Finding Out Which Lync Pool Servers a User is Associated With, and the Preferred Connection Order

Lync 2013 logo 128x128Sometimes, you need to do some Lync logging to investigate a problem with a user. If you have multiple servers in a pool, you sometimes have to enable logging on each until you figure out which one the client is actually connecting to. We can find out which servers the user is associated with and the preferred order that the client will connect using the following in the Lync Management Shell:

Get-CsUserPoolInfo

Such as:

Get-CsUserPoolInfo sip:prichard@contoso.com

The output shows us the primary and backup pool FQDNs, and the order in which it will connect to servers in each pool.

PrimaryPoolFqdn                     : lyncpool01.contoso.local
BackupPoolFqdn                      : lyncpool02.contoso.local
UserServicesPoolFqdn                : lyncpool01.contoso.local
PrimaryPoolMachinesInPreferredOrder : {1:2-2, 1:2-1}
BackupPoolMachinesInPreferredOrder  : {1:3-2, 1:3-1}

But what that doesn’t tell us, is the actual names of the servers in the pool, and which one is 1:2-2, and 1:2-1, etc. So we expand a little further and use:

Get-CsUserPoolInfo -Identity "user" | Select-Object -ExpandProperty PrimaryPoolMachinesInPreferredOrder

For example,

Get-CsUserPoolInfo -Identity "prichard" | Select-Object -ExpandProperty PrimaryPoolMachinesInPreferredOrder

This will show the registrar pools and their respective servers in the preferred order the user will connect:

MachineId         : 1:2-2
Cluster           : 1:2
Fqdn              : lyncpoolserver03.contoso.local
PrimaryMacAddress : 000000
Topology          : Microsoft.Rtc.Management.Deploy.Internal.DefaultTopology
MachineId         : 1:2-1
Cluster           : 1:2
Fqdn              : lyncpoolserver02.contoso.local
PrimaryMacAddress : 000000
Topology          : Microsoft.Rtc.Management.Deploy.Internal.DefaultTopology

We see that this user will connect to lyncpoolserver03 first, since it’s listed first. If that server is not available, then the user would be redirected to lyncpoolserver02. Note that this only shows the information for the primary pool. If you have a backup pool, the information for those servers is not shown here (but is shown if you use BackupPoolMachinesInPrefferedOrder as the ExpandedPropery). However, if you do have a backup registrar pool, and want to use it as a backup pool for users homed on the first, you should have Director servers, as mentioned in Another Reason to Include a Director in Your Lync Server 2010 Deployment.

We can then wrap this in a function:

function Get-CsUserConnectionInfo {
 param (
  [parameter(ValueFromPipeline, ValueFromPipelineByPropertyName, Mandatory, HelpMessage = "No username specified")]
  [ValidateNotNullOrEmpty()]
  [string] $user
 )
 Get-CsUserPoolInfo –Identity $user | Select-Object –ExpandProperty PrimaryPoolMachinesInPreferredOrder
} # end function Get-CsUserConnectionInfo

For easy access. Toss it into your PowerShell profile and access it using

Get-CsUserConnectionInfo

Also, the Get-CsConnections.ps1 script will show you the current connections on a per-user basis if needed.

  1. Jonatan
    November 11th, 2011 at 10:42 | #1

    Nice script!
    Is it possible to get the connection info regarding edge, mediation and so on as well?

    Regards
    Jonatan

  2. July 18th, 2014 at 03:38 | #2

    I’ve noticed there’s an interesting difference in this command when you run it locally on a lync box and when you run it remotely over an implicit powershell connection. I spend nearly all my time using remoting, and so was puzzled to see that when I ran it, I got :

    Get-CsUserPoolInfo domain\user | Select -ExpandProperty PrimaryPoolMachinesInPreferredOrder
    3:1-2
    3:1-1

    You only get more detail when you run a local lync powershell session on an actual server.

  1. August 28th, 2012 at 15:36 | #1
  2. August 14th, 2019 at 00:18 | #2