[This is pre-release documentation and subject to change in future releases. This topic's current status is: Milestone-Ready]

Topic Last Modified: 2010-07-18

In Microsoft Communications Server 2010 it’s very easy to list all the users who belong to a given registrar pool; for example, this command returns the Active Directory display name of all the users who have accounts on the registrar pool atl-cs-001.litwareinc.com:

Copy Code
Get-CsUser –Filter {RegistrarPool –eq " atl-cs-001.litwareinc.com" | Select-Object DisplayName

However, there is no built-in command that can return all the users in a given site. However, that information can be returned by using a Windows PowerShell script that enumerates all the registrar pools in a site, then connects to each pool and returns information about the user accounts homed on that pool. To use the script, copy the code, paste it into a text editor such as Windows Notepad, and then save the file using a .ps1 file extension (for example, C:\Scripts\UsersInASite.Ps1). From within the Communications Server Management Shell you can then run the script by typing in the full path to the script file followed by the Identity site you are interested in:

Copy Code
C:\Scripts\UsersInASite.ps1 Redmond

Here is the script code:

Copy Code
$x = (Get-CsSite -Identity $args[0]).Pools

foreach ($i in $x) 
	{
		(Get-CsUser | Where-Object {$_.RegistrarPool -like $i})| Select-Object DisplayName
}