- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the Azure VM disk encryption settings using PowerShell?
To get the Azure disk encryption settings using PowerShell, we first need to retrieve the VM information using the Get-AzVM command. Before running this command, make sure that you are connected to the Azure account (Connect-AzAccount) and the proper subscription (Set-AzContext).
In this example, we have a TestVM.
$vm = Get-AzVM -Name TestVM
We will use the StorageProfile property and OSdisk sub-property to get the encryption settings.
$vm.StorageProfile.OsDisk.EncryptionSettings
The above command will retrieve the encryption settings for the Azure VM disk encryption.
To retrieve all the azure VMs disk encryption for the specific subscription use,
Get-AzVM | Select Name, ResourceGroupName, @{N='Disk_Encryption';E={$_.StorageProfile.OSDisk.EncryptionSettings}}
Advertisements