Query for unattached disks in Azure

To query for all windows unattached disks (which are not attached to any of the virtual machines), we can use below command:

Get-AzureDisk | Where-Object {($.OS -eq “windows”) -and ($.AttachedTo -eq $null)} | Select diskname

Same way you can find out for Linux related disks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s