Set-AzVMProxyAgentSetting
設定 PSVirtualMachine 物件的 Proxy 代理程式設定屬性。
語法
Default (預設值)
Set-AzVMProxyAgentSetting
-VM <PSVirtualMachine>
[-EnableProxyAgent <Boolean>]
[-WireServerMode <String>]
[-WireServerProfile <String>]
[-ImdsMode <String>]
[-ImdsProfile <String>]
[-KeyIncarnationId <Int32>]
[-AddProxyAgentExtension <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
設定 PSVirtualMachine 物件的 Proxy 代理程式設定屬性。
範例
範例 1
$vmconfig = New-AzVMConfig -VMName $vmName -VMSize "Standard_D2s_v3"
Set-AzVMProxyAgentSetting -VM $vmconfig -EnableProxyAgent $true -AddProxyAgentExtension false -WireServerMode "Enforce" -ImdsProfile "/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version}"
此命令會設定虛擬機器組態物件 $vmconfig的 Proxy Agent 設定。
它啟用 Proxy 代理程式,將有線伺服器模式設定為「強制執行」,並指定 IMDS 設定檔。
參數
-AddProxyAgentExtension
指定是否隱含地安裝 ProxyAgent 延伸模組。 此選項目前僅適用於 Linux 作業系統。
參數屬性
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
參數屬性
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-EnableProxyAgent
指定是否應啟用中繼資料安全通訊協定 (ProxyAgent) 特性。
參數屬性
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-ImdsMode
指定 IMDS 端點執行模式。
在稽核模式中,系統的作用就像是強制執行訪問控制原則,包括在記錄中發出存取拒絕專案,但它實際上不會拒絕任何對主機端點的要求。
在 [強制執行] 模式中,系統會強制執行訪問控制,這是建議的作業模式。
參數屬性
| 類型: | String
|
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-ImdsProfile
指定 IMDS enpoint 中的 InVMAccessControlProfileVersion 資源識別碼。
/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} 的格式
參數屬性
| 類型: | String
|
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-KeyIncarnationId
增加此參數的值可讓使用者重設用於保護訪客與主機之間通訊通道的金鑰。
參數屬性
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-VM
PSVirtualMachine 從 New-AzVMConfig 建立的物件。
參數屬性
參數集
(All)
| Position: | Named |
| 必要: | True |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-WireServerMode
指定建立虛擬機器或虛擬機器擴展集時的 Wire Server 端點執行模式。
在稽核模式中,系統的作用就像是強制執行訪問控制原則,包括在記錄中發出存取拒絕專案,但它實際上不會拒絕任何對主機端點的要求。
在 [強制執行] 模式中,系統會強制執行訪問控制,這是建議的作業模式。
參數屬性
| 類型: | String
|
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-WireServerProfile
指定 InVMAccessControlProfileVersion Wire Server 端點中的資源識別碼。
/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version} 的格式
參數屬性
| 類型: | String
|
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
CommonParameters
此 Cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。
輸出