View audit logs for Azure using PowerShell

View Azure logs using PowerShell

John Savill

August 14, 2016

1 Min Read
View audit logs for Azure using PowerShell

Q. How can I look at audit logs for Azure using PowerShell?

A. The Get-AzureRmLog will show logs for a certain resource group from a given time. This can then be searched for certain actions. For example to find all VMs started in the last hour I can use:

Get-AzureRmLog -ResourceGroup $rgname -StartTime (Get-Date).AddHours(-1) |     Where-Object OperationName -eq Microsoft.Compute/virtualMachines/start/action

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like