Skip to content
May 13, 2016 / Don

Getting the Status of all Azure VM’s

I wanted to make sure all my VM’s were shut off in my lab when I’ve completed. Since I’ve converted everything to the resource manager, I couldn’t just use “Get-AzureVM –status” so I came up with this.

 

cls
Get-AzureRmVM -ResourceGroupName dw-ResourceGroup | foreach{
$vm = Get-AzureRmVM -ResourceGroupName dw-ResourceGroup -name $_.name -status
write-host ".."
write-host ".."
write-host "Server  Name – " $_.name
$vm.Statuses.displaystatus[1]}
write-host ".."

 

You want to see “VM deallocated”

 

image

Advertisements

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

%d bloggers like this: