Topic Last Modified: 2010-10-01

Returns information about the online status (True or False) of one or more Microsoft Lync Server 2010 user databases.

Syntax

Get-CsUserDatabaseState [-Identity <String>]
Get-CsUserDatabaseState [-RegistrarPool <Fqdn>]

Parameters

Parameter Required Type Description

Identity

Optional

String

Unique identifier of the user database whose online status is to be returned. For example: -Identity "UserDatabase:atl-sql-001.litwareinc.com".

You cannot use both Identity and RegistrarPool in the same command, nor can you use wildcards with either parameter. If both parameters are omitted Get-CsUserDatabaseState returns information about all the user databases currently in use.

RegistrarPool

Optional

String

Fully qualified domain name of the Registrar pool hosting the user databases whose online status is to be returned. For example: -RegistrarPool "atl-cs-001.litwareinc.com".

You cannot use both Identity and RegistrarPool in the same command, nor can you use wildcards with either parameter. If both parameters are omitted Get-CsUserDatabaseState returns information about all of the user databases currently in use.

Force

Optional

Switch Parameter

Suppresses the display of any non-fatal error message that might arise when running the command.

Detailed Description

Lync Server 2010 employs the user database (also known as the user store) to maintain presence and routing information for Lync Server users. The Get-CsUserDatabaseState cmdlet provides a way to verify the current status (either online or offline) for any of the user databases currently in use in your organization.

Note that, by default, the firewall exceptions for SQL Server Express are not enabled when you install the Standard Edition of Lync Server 2010. In turn, that means that you will not be able to run Get-CsUserDatabaseState from a remote instance of Windows PowerShell. That’s because your command will not be able to traverse the firewall and access the SQL Server Express database. You can still run the cmdlet locally (that is, on the Standard Edition server itself). However, to run Get-CsUserDatabaseState remotely you will need to manually enable the firewall exceptions for SQL Server Express.

Who can run this cmdlet: By default, members of the following groups are authorized to run the Get-CsUserDatabaseState cmdlet locally: RTCUniversalServerAdmins. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself) run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Get-CsUserDatabaseState"}

Input Types

None. Get-CsUserDatabaseState does not accept pipelined input.

Return Types

Get-CsUserDatabaseState returns instances of the Microsoft.Rtc.Management.Xds.UserStoreState object.

Example

-------------------------- Example 1 ------------------------

Copy Code
Get-CsUserDatabaseState

The command shown in Example 1 returns the online status of each user database configured for use in your organization.

-------------------------- Example 2 ------------------------

Copy Code
Get-CsUserDatabaseState -Identity "UserDatabase:atl-sql-001.litwareinc.com"

The command shown in Example 2 returns the online status of a single user database: the database with the Identity UserDatabase:atl-sql-001.litwareinc.com.

-------------------------- Example 3 ------------------------

Copy Code
Get-CsUserDatabaseState -RegistrarPool "atl-cs-001.litwareinc.com"

In Example 3, status information is returned for all the user databases located in the Registrar pool atl-cs-001.litwareinc.com.

-------------------------- Example 4 ------------------------

Copy Code
Get-CsUserDatabaseState | Where-Object {$_.Online -eq $True}

In the preceding example, information is returned for all the user databases that are currently online. To do this, the command first calls Get-CsUserDatabaseState without any parameters. That returns a collection of all the user databases in use in the organization. That collection is then piped to the Where-Object cmdlet, which picks out only those databases where the Online property is equal to True.

See Also