Get-AzBatchRemoteDesktopProtocolFile
從計算節點取得 RDP 檔案。
語法
Get-AzBatchRemoteDesktopProtocolFile
[-PoolId] <String>
[-ComputeNodeId] <String>
-DestinationPath <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchRemoteDesktopProtocolFile
[-PoolId] <String>
[-ComputeNodeId] <String>
-DestinationStream <Stream>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchRemoteDesktopProtocolFile
[[-ComputeNode] <PSComputeNode>]
-DestinationPath <String>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzBatchRemoteDesktopProtocolFile
[[-ComputeNode] <PSComputeNode>]
-DestinationStream <Stream>
-BatchContext <BatchAccountContext>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzBatchRemoteDesktopProtocolFile Cmdlet 會從計算節點取得遠端桌面通訊協定 (RDP) 檔案,並將其儲存為檔案或使用者提供的數據流。
範例
範例 1:從指定的計算節點取得 RDP 檔案並儲存盤案
Get-AzBatchRemoteDesktopProtocolFile -PoolId "Pool06" -ComputeNodeId "ComputeNode01" -DestinationPath "C:\PowerShell\ComputeNode01.rdp" -BatchContext $Context
此命令會從具有ID Pool06之集區中標識碼 ComputeNode01 的計算節點取得 RDP 檔案。 此命令會將 .rdp 檔案儲存為 C:\PowerShell\MyComputeNode.rdp。 使用 Get-AzBatchAccountKey Cmdlet 將內容指派給$Context變數。
範例 2:從計算節點取得 RDP 檔案,並使用管線儲存盤案
Get-AzBatchComputeNode -PoolId "Pool06" -Id "ComputeNode02" -BatchContext $Context | Get-AzBatchRemoteDesktopProtocolFile -DestinationPath "C:\PowerShell\MyComputeNode02.rdp" -BatchContext $Context
此命令會取得具有ID Pool06集區中標識碼 ComputeNode02 的計算節點。 命令會使用管線運算符,將計算節點傳遞至目前的 Cmdlet。 目前的 Cmdlet 會從計算節點取得 .rpd 檔案,然後將內容儲存為名為 C:\PowerShell\MyComputeNode02.rdp 的檔案。
範例 3:從指定的計算節點取得 RDP 檔案,並將它導向至數據流
$Stream = New-Object -TypeName "System.IO.MemoryStream"
Get-AzBatchRemoteDesktopProtocolFile "Pool06" -ComputeNodeId "ComputeNode03" -DestinationStream $Stream -BatchContext $Context
第一個命令會使用 New-Object Cmdlet 建立數據流,然後將它儲存在$Stream變數中。 第二個命令會從具有ID Pool06之集區中標識碼 ComputeNode03 的計算節點取得 .rdp 檔案。 命令會將檔案內容導向$Stream中的數據流。
參數
-BatchContext
指定此 Cmdlet 用來與 Batch 服務互動的 BatchAccountContext 實例。 如果您使用 Get-AzBatchAccount Cmdlet 來取得 BatchAccountContext,則與 Batch 服務互動時,將會使用Microsoft Entra 驗證。 若要改用共用密鑰驗證,請使用 Get-AzBatchAccountKey Cmdlet 來取得已填入其存取金鑰的 BatchAccountContext 物件。 使用共用金鑰驗證時,預設會使用主要存取金鑰。 若要變更要使用的密鑰,請設定 BatchAccountContext.KeyInUse 屬性。
類型: | BatchAccountContext |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ComputeNode
將計算節點指定為 .rdp 檔案所指向 PSComputeNode 物件。 若要取得計算節點物件,請使用 Get-AzBatchComputeNode Cmdlet。
類型: | PSComputeNode |
Position: | 0 |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-ComputeNodeId
指定 .rdp 檔案所指向之計算節點的標識碼。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DestinationPath
指定此 Cmdlet 儲存 .rdp 檔案的檔案路徑。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-DestinationStream
指定此 Cmdlet 導向 RDP 資料的數據流。 此 Cmdlet 不會關閉或倒轉此資料流。
類型: | Stream |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PoolId
指定集區的標識碼,其中包含這個 Cmdlet 從中取得 .rdp 檔案的計算節點。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |