Invoke-RASRDSSessionCmd

NAME

Invoke-RASRDSSessionCmd

SYNOPSIS

Sends RDS session commands.

SYNTAX

Invoke-RASRDSSessionCmd [-RDSServer] <string> [[-SiteId] <uint>] -Command <RDSSessionCmd> {LogOff | SendMsg | Disconnect} -Id <uint> [-Message <string>] [-MsgTitle <string>] [<CommonParameters>]

Invoke-RASRDSSessionCmd [-RDSId] <uint> -Command <RDSSessionCmd> {LogOff | SendMsg | Disconnect} -Id <uint> [-Message <string>] [-MsgTitle <string>] [<CommonParameters>]

Invoke-RASRDSSessionCmd [-InputObject] <RDPSession> -Command <RDSSessionCmd> {LogOff | SendMsg | Disconnect} [-Message <string>] [-MsgTitle <string>] [<CommonParameters>]

DESCRIPTION

Sends a session command such as LogOff, Disconnect, or Send Message.

It will only fail with an error if the name or ID of the RD Session Host server is invalid or command does not reach the destination.

If the session ID is invalid, the command will not fail.

PARAMETERS


-RDSServer <string>
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.

        Required?                    true
        Position?                    0
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false

-SiteId <uint>
Site ID.

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

        Required?                    false
        Position?                    1
        Default value                0
        Accept pipeline input?       false
        Accept wildcard characters?  false

-RDSId <uint>
The ID of an RD Session Host server.

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

        Required?                    true
        Position?                    0
        Default value                0
        Accept pipeline input?       false
        Accept wildcard characters?  false

-Id <uint>
Session ID.

To obtain the RDS Session ID, use the Get-RDSStatus command with StatusLevel as Level2.

        Required?                    true
        Position?                    named
        Default value                0
        Accept pipeline input?       false
        Accept wildcard characters?  false

-InputObject <RDPSession>
The RDS Session Object.

To obtain an RDSSession object representing an RD Session, use the Get-RDSStatus command with StatusLevel as Level2."

        Required?                    true
        Position?                    0
        Default value                
        Accept pipeline input?       true (ByValue)
        Accept wildcard characters?  false

-Command <RDSSessionCmd>
Session command.

Accepted values: LogOff, SendMsg, Disconnect.

Possible values: LogOff, SendMsg, Disconnect

        Required?                    true
        Position?                    named
        Default value                0
        Accept pipeline input?       false
        Accept wildcard characters?  false

-MsgTitle <string>
The message title for the session message.

        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false

-Message <string>
The session message to be sent.

        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false

<CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters documentation. 

INPUTS

RDPSession

OUTPUTS

-none-

EXAMPLES


---------- EXAMPLE 1 ----------

Invoke-RASRDSSessionCmd "server.company.dom" -Command LogOff -Id 6

Send the LogOff command to the server specified by name in the Licensing Server site (default).

To obtain the session ID, use the Get-RDSStatus cmdlet with StatusLevel as Level2.

---------- EXAMPLE 2 ----------

Invoke-RASRDSSessionCmd -RDSId 10 -Command SendMsg -Id 6 -Message "This is a message"

Send the SendMsg command to the server specified by ID to send the specified message.

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

To obtain the session ID, use the Get-RASRDSStatus cmdlet with StatusLevel as Level2.

---------- EXAMPLE 3 ----------

$RDPSession | Invoke-RASRDSSessionCmd -Command Disconnect

Send the Disconnect command for the session, which is identified by an object obtained from the pipeline output.

To obtain the $RDPSession object, use the Get-RASRDSStatus cmdlet with StatusLevel as Level2.

RELATED LINKS