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
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
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
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.
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.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.