[This is preliminary documentation and is subject to change. Blank topics are included as placeholders.]

Get-CsWindowsService returns detailed information about Microsoft Communications Server 2010 components that run as Windows services.

Syntax

Get-CsWindowsService [-Name <String>] [-ComputerName <String>] [-ExcludeActivityLevel <SwitchParameter>] [-Report <String>]

Parameters

Parameter Required Type Description

Name

Optional

String

Name of the Microsoft Communications Server service you want to return information for. Note that you must use the service name (e.g., RTCCAA) and not the service display name (e.g., Microsoft Communications Server Conferencing Attendant). You can only pass a single service name to the -Name parameter; in addition you cannot use wildcards in the service name.

Note, too that Get-CsWindowsService can only return information for Microsoft Communications Server services; you cannot use this cmdlet to return information on other Windows services. For those services, you might be able to use Windows PowerShell’s Get-Service cmdlet.

If you do not include this parameter Get-CsWindowsService will return information about all your Microsoft Communications Server services.

ComputerName

Optional

String

Name of the remote computer from which service information is to be retrieved; if this parameter is not included, then Get-CsWindowsService will return information about the Microsoft Communications Server services running on the local computer. The remote computer should be referenced using its fully qualified domain name; for example, atl-mcs-001.litwareinc.com.

ExcludeActivityLevel

Optional

Switch Parameter

If included, this parameter causes Get-CsWindowsService to return only the service status and not the service activity level.

Report

Optional

String

Path to an HTML file where error information can be stored. If this parameter is included, any errors that occur during the running of this cmdlet will be logged to the specified file (e.g., C:\Logs\Service_report.html).

Force

Optional

Switch Parameter

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

Detailed Description

Many Communications Server 2010 components run as standard Windows services; for example, the Communications Server Conferencing Attendant component is actually a service named RTCCAA. The Get-CsWindowsService cmdlet enables you to retrieve detailed information about these Microsoft Communications Server services, and only about these Microsoft Communications Server services. That’s because the cmdlet has been designed to ignore any service that is not part of Microsoft Communications Server.

The fact that Get-CsWindowsService automatically filters out non-Communications Server services is one advantage the cmdlet offers over the generic Get-Service cmdlet that ships as part of Windows PowerShell. In addition to that, there is another important reason to use Get-CsWindowsService if you need to retrieve information for a Microsoft Communications Server service: Get-CsWindowsService returns useful data that Get-Service does not return. For example, when returning information about the Conferencing Attendant service Get-CsWindowsService reports back the number of concurrent calls being handled by the service (the service activity level). Get-Service does not.

By default Get-CsWindowsService runs against the local computer. However, by including the -ComputerName parameter you can return information about the Microsoft Communications Server services running on a remote computer.

Return Types

Get-CsWindowsService returns instances of the Microsoft.Rtc.Management.Deployment.Core.NTService object.

Examples

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

Copy Code
Get-CsWindowsService

The command shown in Example 1 returns information about the Microsoft Communications Server services running on the local computer. This is done by calling Get-CsWindowsService without any parameters.

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

Copy Code
Get-CsWindowsService | Format-List

Example 2 also returns information about the Microsoft Communications Server services on the local computer; in this case, however, the data is displayed in list format. (Among other things, this enables you to view all the property values for each service. In the default, tabular view, only a subset of property values are displayed.) To carry out this task, Get-CsWindowsService is first called, then the resulting information is piped to the Format-List cmdlet.

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

Copy Code
Get-CsWindowsService -Name "RTCSrv"

Example 3 returns information for a single Microsoft Communications Server service: the service with the name RTCSrv.

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

Copy Code
Get-CsWindowsService -Name "RTCSrv" | Select-Object -ExpandProperty RoleName

In Example 4, detailed information is displayed for all the service roles handled by the RTCSrv service. To perform this task, Get-CsWindowsService is first used to return information about the RTCSrv service. This information is then piped to the Select-Object cmdlet; Select-Object uses its -ExpandProperty parameter to display, in easy-to-read fashion, all the roles handled by the RTCSrv service.

-------------------------- Example 5 ------------------------

Copy Code
Get-CsWindowsService -Computer atl-cs-001.litwareinc.com

The command shown in Example 5 returns information about the Microsoft Communications Server services on the remote computer atl-cs-001.litwareinc.com. This is done by including the -ComputerName parameter followed by the fully qualified domain name of the remote computer.

-------------------------- Example 6 ------------------------

Copy Code
Get-CsWindowsService -Report C:\Services.html

The preceding command returns information about all the Microsoft Communications Server services on the local computer. In addition, the -Report parameter is included in order to save error information to a file named C:\Services.html. If Get-CsWindowsService encounters any problems in retrieving service data, information about that problem will be recorded in Services.html. For example, that file might include a note similar to this: "Failed to get counter CPS - 010 - Total parked calls of service RTCCPS."

-------------------------- Example 7 ------------------------

Copy Code
Get-CsWindowsService | Where-Object {$_.Status -eq "Running"}

In Example 7, information is returned only for the Microsoft Communications Server services on the local computer that are currently running. To accomplish this, the command first calls Get-CsWindowsService to return a collection of all the Microsoft Communications Server services, running or not running. This collection is then piped to the Where-Object cmdlet, which picks out only those services where the Status property is equal to (-eq) Running.

-------------------------- Example 8 ------------------------

Copy Code
Get-CsWindowsService | Where-Object {$_.DisplayName -like "*Application Sharing*"}

Example 8 show how you can retrieve information for a particular service even if you do not know the actual name of that service (in this case, RTCASMCU). To perform this task, Get-CsWindowsService is first called without any parameters; that returns a collection of all the Microsoft Communications Server services on the local computer. This collection is then piped to the Where-Object cmdlet, which selects only the one service where the DisplayName property includes (-like) the string value "Application Sharing". The end result: information is displayed for the Communications Server Application Sharing service.

-------------------------- Example 9 ------------------------

Copy Code
Get-CsWindowsService | Where-Object {$_.RoleName -contains "ApplicationServer"}

Example 9 returns information about the service that hosts the ApplicationServer role. To do this, the command first calls Get-CsWindowsService to return a collection of all the Microsoft Communications Server services on the local computer. This collection is then piped to the Where-Object cmdlet, which selects those services where the RoleName property includes (-contains) the role ApplicationServer.