共用方式為


Lync Server Admin Guide: Managing Computers in Your Topology

This article is part of the Microsoft Lync Server 2010 Administration Guide: PowerShell Supplement.

View a List of Computers Running Lync Server 2010

  • To view a list of computers running Lync Server

Although not quite a perfect match, the following script largely replicates the information found on the Topology\Status tab in the Lync Server Control Panel:

$errorPref = $errorActionPreference

$errorActionPreference = "SilentlyContinue"

 

$arrObjects = @()

$computers = Get-CsComputer | Sort-Object Identity

 

foreach ($objComputer in $computers)

   {

        $objSite = Get-CsPool -Identity $objComputer.pool | Select-Object Site

        $objReplication = $Null

        $objReplication = Get-CsManagementStoreReplicationStatus -ReplicaFqdn `

            $objComputer.Identity | Select-Object UpToDate

        $strReplication = $objSite.site -replace("Site:","")

 

        $objDisplayObject = New-Object PSObject

        Add-Member -InputObject $objDisplayObject -memberType NoteProperty `

            -Name Identity -Value $objComputer.Identity

        Add-Member -InputObject $objDisplayObject -memberType NoteProperty `

             -Name Pool -Value $objComputer.Pool

        Add-Member -InputObject $objDisplayObject -memberType NoteProperty `

             -Name Site -Value $strReplication

        Add-Member -InputObject $objDisplayObject -memberType NoteProperty `

             -Name UpToDate -Value $objReplication.UpToDate

 

        $arrObjects += $objDisplayObject

}

 

$labels = @{Expression={$_.Identity};Label="Computer"}, `

          @{Expression={$_.Pool};Label="Pool"}, `

          @{Expression={$_.Site};Label="Site"}, `

          @{Expression={$_.UpToDate};Label="Replication"}

 

$arrObjects | Format-Table $labels

$errorActionPreference = $errorPref

 

To use this script, copy the code, paste it into a text editor, and then save the file using a .ps1 file extension (for example, C:\Scripts\Status.ps1). From there all you have to do is run the script from within the Lync Server Management Shell. For example:

C:\Scripts\Status.ps1

 

 

For more information

View the Status of Services Running on a Computer

  • To view the status of services running on a computer

To view the status of all the Lync Server services running on all your computers, use the following command:

Get-CsService | Select-Object Role, PoolFqdn | Sort-Object PoolFqdn, Role

To view the services running on a specific computer, use this command, replacing atl-cs-001.litwareinc.com with the fully qualified domain name of the computer to be checked:

Get-CsService | Where-Object {$_.PoolFqdn –eq "atl-cs-001.litwareinc.com"} | Select-Object Role, PoolFqdn | Sort-Object PoolFqdn, Role

For more information

View Details About a Service

  • To view details for a service

To view detailed information for a particular Lync Server service or server role, use the Get-CsService cmdlet followed by the service Identity:

Get-CsService –Identity service:Registrar:atl-cs-001.litwareinc.com

 

To view detailed information for all your Lync Server services or server roles, call Get-CsService without any parameters:

 

Get-CsService

 

 

For more information

 

 

 

 

Start or Stop Lync Server 2010 Services

  • To start or stop all Lync Server services on a computer

To start all the Lync Server services on a computer, use the Start-CsWindowsService cmdlet:

Start-CsWindowsService -ComputerName atl-cs-001.litwareinc.com

 

Note that the ComputerName parameter is not required if you are starting the Lync Server services on the local computer.

 

To stop all the Lync Server services on a computer, use the Stop-CsWindowsService cmdlet:

Stop-CsWindowsService -ComputerName atl-cs-001.litwareinc.com

 

  • To start or stop a specific service

To start a specific service, use the Start-CsWindowsService cmdlet along with the Name parameter:

Start-CsWindowsService –Name "RTCRGS" -ComputerName atl-cs-001.litwareinc.com

 

Use the Stop-CsWindowsService cmdlet to stop a specified service:

 

Stop-CsWindowsService –Name "RTCRGS" -ComputerName atl-cs-001.litwareinc.com

 

 

 

 

For more information

Prevent Sessions for Services

  • To prevent new sessions for all Lync Server services on a computer

To prevent new sessions for all the Lync Server services on a computer use the following command:

Get-CsWindowsService | Stop-CsWindowsService -ComputerName atl-cs-001.litwareinc.com –Graceful

 

The Graceful parameter used with the Stop-CsWindowsService cmdlet ensures that all existing sessions will be honored but no new sessions will be allowed.

 

 

  • To prevent new sessions for a specific service

To prevent new sessions for a specific Lync Server service, use the following command:

 

Stop-CsWindowsService -Name "RTCRGS" -ComputerName atl-cs-001.litwareinc.com -Graceful

For more information

View Microsoft SIP Processing Language (MSPL) Server Applications

To return information for all of your MSPL server applications, use the Get-CsServerApplication cmdlet:

Get-CsServerApplication

The following command returns information for a specific application:

Get-CsServerApplication -Identity "service:Registrar:atl-cs-001.litwareinc.com/ExumRouting"

And this command returns information about all the applications running under a specific service:

Get-CsServerApplication -Identity "service:EdgeServer:atl-edge-001.litwareinc.com"

 

 

For more information

Enable or Disable a Microsoft SIP Processing Language (MSPL) Server Application

  • To enable or disable an MSPL server application

To enable an MPSL server application, use the Set-CsServerApplication cmdlet and set the Enabled property to True:

Set-CsServerApplication -Identity "Registrar:atl-cs-001.litwareinc.com/ExumRouting" -Enabled $True

 

To disable an MPSL server application, set the Enabled property to False:

 

Set-CsServerApplication -Identity "Registrar:atl-cs-001.litwareinc.com/ExumRouting" -Enabled $False

 

 

For more information

Mark a Microsoft SIP Processing Language (MSPL) Application as Critical or Not Critical

  • To mark or unmark an MSPL server application as critical

To mark an MPSL server application as critical, use the Set-CsServerApplication cmdlet and set the Critical property to True:

Set-CsServerApplication -Identity "Registrar:atl-cs-001.litwareinc.com/QoEAgent" -Critical $True

 

To mark an MPSL server application as not being critical, set the Critical property to False:

Set-CsServerApplication -Identity "Registrar:atl-cs-001.litwareinc.com/QoEAgent" -Critical $False

 

 

For more information

View a List of Trusted Applications

  • To view a list of trusted applications

To return information for all your trusted applications, call Get-CsTrustedApplication without any parameters:

Get-CsTrustedApplication

 

To return information about a single application, use the Identity parameter followed by the application Identity:

 

Get-CsTrustedApplication -Identity TrustPool.litwareinc.com/tapp2

 

For more information

View the Simple URL Details

  • To view Simple URL details

To return information about the Simple URLs configured for use in your organization, use the following command:

Get-CsSimpleUrlConfiguration | Select-Object –Expand SimpleUrl

For more information