Share via

Az Powershell to get disk encryption is pmk or cmk

MS Techie 2,761 Reputation points
2023-09-19T22:25:50.0666667+00:00

The azure vm disk can be cmk or pmk encrypted. Which azure powershell command let's me find the disk encryption type is pmk or cmk. (Note - i am only bothered about pmk and cmk encryption and not other encryption)

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

Azure Disk Encryption
Azure Disk Encryption

An Azure service for virtual machines (VMs) that helps address organizational security and compliance requirements by encrypting the VM boot and data disks with keys and policies that are controlled in Azure Key Vault.

0 comments No comments

Answer accepted by question author
  1. TP 155.6K Reputation points Volunteer Moderator
    2023-09-20T00:00:39.29+00:00

    Hi,

    Please see sample code below:

    $disk = Get-AzDisk -ResourceGroupName myResourceGroup -Name myDisk
    $disk.Encryption.Type
    

    azure managed disk encryption type powershell sample

    If Type = EncryptionAtRestWithPlatformKey then it is PMK, if Type = EncryptionAtRestWithCustomerKey it is CMK.

    Please click Accept Answer if the above was useful.

    Thanks.

    -TP

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.