Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Identify All Stopped Azure Virtual Machines with PowerShell

$
0
0

Summary: Identify virtual machines that are shut down, but are consuming billing time.

Hey, Scripting Guy! Question How can I use Windows PowerShell to track virtual machines that are not shut down from
           the management portal in Azure?

Hey, Scripting Guy! Answer Use the Get-AzureVM cmdlet, and filter on 'StoppedVM' status:

Get-AzureVM | Where { $_.Status –eq 'StoppedVM' }

You can then properly shut down all of them with the Stop-AzureVM cmdlet:

Get-AzureVM | Where { $_.Status –eq 'StoppedVM' } | Stop-AzureVM


Viewing all articles
Browse latest Browse all 3333

Trending Articles