For the complete documentation index, see llms.txt. This page is also available as Markdown.

Invoke-RASRDSHostCmd

SYNOPSIS

Sends a command to the RDS.

SYNTAX

Invoke-RASRDSHostCmd [-Id] <uint>
 -Command {EnableLogons | DrainUntilReboot | Drain | DisableLogonsAndReconnections | InstallTSRole | Reboot | CancelSchedule | Shutdown}
 [<CommonParameters>]
Invoke-RASRDSHostCmd [-InputObject] <RDPSession>
 -Command {EnableLogons | DrainUntilReboot | Drain | DisableLogonsAndReconnections | InstallTSRole | Reboot | CancelSchedule | Shutdown}
 [<CommonParameters>]
Invoke-RASRDSHostCmd [-RDSServer] <string> [[-SiteId] <uint>]
 -Command {EnableLogons | DrainUntilReboot | Drain | DisableLogonsAndReconnections | InstallTSRole | Reboot | CancelSchedule | Shutdown}
 [<CommonParameters>]

DESCRIPTION

Sends a command to the RDS.

It will only fail with an error if the name or ID of the target RD Session Host server is invalid.

EXAMPLES

Example 1

Invokes a restart on the RDS Server.

Example 2

The RDS Server will not allow new sessions until server is rebooted.

Example 3

The disabled state set by the RAS Scheduler is cancelled.

PARAMETERS

-RDSServer

The name of a RD Session Host server.

The name can be either FQDN or IP address, but you have to enter the actual name this server has in the RAS farm.

-SiteId

Site ID.

If the parameter is omitted, the Licensing Server site ID will be used.

-Id

The ID of a RD Session Host server.

To obtain the ID, use the Get-RASRDSHost cmdlet.

-InputObject

The RDS Object.

To obtain a RDS object use the Get-RASRDSHost command.

Type reference: RDPSession

-Command

Session command.

Accepted values: LogOff, SendMsg, Disconnect.

Possible values: EnableLogons, DrainUntilReboot, Drain, DisableLogonsAndReconnections, InstallTSRole, Reboot, CancelSchedule, Shutdown

Type reference: RDSCmd

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

RDPSession

OUTPUTS

None

Last updated