Modifier

Partager via


Remove-RDSessionHost

Removes one or more RD Session Host servers from a session collection.

Syntax

Remove-RDSessionHost
      [-SessionHost] <String[]>
      [-ConnectionBroker <String>]
      [-Force]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-RDSessionHost cmdlet removes one or more Remote Desktop Session Host (RD Session Host) servers from a session collection. The servers remain part of the deployment.

RD Session Host is a Remote Desktop Services role service that lets users share Windows-based programs or the full Windows desktop. Users can connect to an RD Session Host server to run programs, save files, and use network resources on that server.

Examples

Example 1: Remove a session host

PS C:\> Remove-RDSessionHost -SessionHost @("rdsh.contoso.com") -ConnectionBroker "rdcb.contoso.com" -Force

This command removes the session host named rdsh.contoso.com from the session collection.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionBroker

Specifies the Remote Desktop Connection Broker (RD Connection Broker) server for this Remote Desktop deployment. If this parameter does not appear, the default value is the fully qualified domain name (FQDN) of the local host.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SessionHost

Specifies an array that contains the name(s) of one or more servers that run the RD Session Host role and that you remove from the session collection.

Type:String[]
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Null