Get-AzActivityLog

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzActivityLog PowerShell command with certain examples.

Get-AzActivityLog

This Azure PowerShell command can help you retrieve the lists of Activity Log events from your Azure Subscription.

Syntax

Get-AzActivityLog
Get-AzActivityLog [-MaxRecord <Int32>]
Get-AzActivityLog
 [-StartTime <DateTime>]
Get-AzActivityLog
 [-StartTime <DateTime>]
 [-EndTime <DateTime>]
Get-AzActivityLog [-CorrelationId] <String>

Examples

Let’s discuss a few examples of how to use the Get-AzActivityLog PowerShell command.

Example – 1

You can execute the below Azure PowerShell command to get the complete lists of Activity Log events from your Azure Subscription.

Get-AzActivityLog

After executing the above command, I got the below output

Get-AzActivityLog

Note that the output above is not the complete output, as the actual output is lengthy.

Example-2

You can also execute the below Azure PowerShell command to get an event log list with the specified maximum number of events, i.e., 2.

Get-AzActivityLog -MaxRecord 2

After executing the above command, I got the expected output as shown in the screenshot below.

Get-AzActivityLog PowerShell

Example-3

You can also execute the below Azure PowerShell command to get an event log list with the specified start time.

Get-AzActivityLog -StartTime 2023-09-01T10:30

After executing the above PowerShell command, I got the below-expected output

Get-AzActivityLog -StartTime

Video Tutorial

Wrapping Up

In this Azure article, we discussed the syntax and usage of the Get-AzActivityLog PowerShell command with certain examples. Thanks for reading this article !!!

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!