如何透過 PowerShell 獲取 Azure VM 磁碟加密設定?
要透過 PowerShell 獲取 Azure 磁碟加密設定,我們首先需要使用 Get-AzVM 命令檢索 VM 資訊。在執行此命令之前,請確保已連線到 Azure 帳戶 (Connect-AzAccount) 和適當的訂閱 (Set-AzContext)。
在此示例中,我們有一個 TestVM。
$vm = Get-AzVM -Name TestVM
我們將使用 StorageProfile 屬性和 OSdisk 子屬性來獲取加密設定。
$vm.StorageProfile.OsDisk.EncryptionSettings
上述命令將檢索 Azure VM 磁碟加密的加密設定。
要檢索特定訂閱的所有 azure VM 磁碟加密,請使用,
Get-AzVM | Select Name, ResourceGroupName,
@{N='Disk_Encryption';E={$_.StorageProfile.OSDisk.EncryptionSettings}}
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP