Edit

Share via


Get-AzBatchRemoteDesktopProtocolFile

Gets an RDP file from a compute node.

Syntax

Id_Path (Default)

Get-AzBatchRemoteDesktopProtocolFile
    [-PoolId] <String>
    [-ComputeNodeId] <String>
    -DestinationPath <String>
    -BatchContext <BatchAccountContext>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Id_Stream

Get-AzBatchRemoteDesktopProtocolFile
    [-PoolId] <String>
    [-ComputeNodeId] <String>
    -DestinationStream <Stream>
    -BatchContext <BatchAccountContext>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

InputObject_Path

Get-AzBatchRemoteDesktopProtocolFile
    [[-ComputeNode] <PSComputeNode>]
    -DestinationPath <String>
    -BatchContext <BatchAccountContext>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

InputObject_Stream

Get-AzBatchRemoteDesktopProtocolFile
    [[-ComputeNode] <PSComputeNode>]
    -DestinationStream <Stream>
    -BatchContext <BatchAccountContext>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzBatchRemoteDesktopProtocolFile cmdlet gets a Remote Desktop Protocol (RDP) file from a compute node and saves it as a file or to a user supplied stream.

Examples

Example 1: Get an RDP file from a specified compute node and save the file

Get-AzBatchRemoteDesktopProtocolFile -PoolId "Pool06" -ComputeNodeId "ComputeNode01" -DestinationPath "C:\PowerShell\ComputeNode01.rdp" -BatchContext $Context

This command gets an RDP file from the compute node that has the ID ComputeNode01 in the pool that has the ID Pool06. The command saves the .rdp file as C:\PowerShell\MyComputeNode.rdp. Use the Get-AzBatchAccountKey cmdlet to assign a context to the $Context variable.

Example 2: Get an RDP file from a compute node and save the file by using the pipeline

Get-AzBatchComputeNode -PoolId "Pool06" -Id "ComputeNode02" -BatchContext $Context | Get-AzBatchRemoteDesktopProtocolFile -DestinationPath "C:\PowerShell\MyComputeNode02.rdp" -BatchContext $Context

This command gets the compute node that has the ID ComputeNode02 in the pool that has the ID Pool06. The command passes that compute node to the current cmdlet by using the pipeline operator. The current cmdlet gets an .rpd file from the compute node, and then saves the contents as a file that is named C:\PowerShell\MyComputeNode02.rdp.

Example 3: Get a RDP file from a specified compute node and direct it to a stream

$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchRemoteDesktopProtocolFile "Pool06" -ComputeNodeId "ComputeNode03" -DestinationStream $Stream -BatchContext $Context

The first command creates a stream by using the New-Object cmdlet, and then stores it in the $Stream variable. The second command gets an .rdp file from the compute node that has the ID ComputeNode03 in the pool that has the ID Pool06. The command directs file contents to the stream in $Stream.

Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Microsoft Entra authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKey cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.

Parameter properties

Type:BatchAccountContext
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputeNode

Specifies a compute node, as a PSComputeNode object, to which the .rdp file points. To obtain a compute node object, use the Get-AzBatchComputeNode cmdlet.

Parameter properties

Type:PSComputeNode
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

InputObject_Path
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
InputObject_Stream
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputeNodeId

Specifies the ID of the compute node to which the .rdp file points.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Id_Path
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
Id_Stream
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationPath

Specifies the file path where this cmdlet saves the .rdp file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Id_Path
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
InputObject_Path
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationStream

Specifies the stream into which this cmdlet directs the RDP data. This cmdlet does not close or rewind this stream.

Parameter properties

Type:Stream
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Id_Stream
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
InputObject_Stream
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PoolId

Specifies the ID of the pool that contains the compute node from which this cmdlet gets an .rdp file.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Id_Path
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
Id_Stream
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

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

Inputs

String

PSComputeNode

BatchAccountContext

Outputs

Void