In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzActivityLog PowerShell command with certain examples.
Table of Contents
Get-AzActivityLog
This Azure PowerShell command can help you retrieve the lists of Activity Log events from your Azure Subscription.
Syntax
Get-AzActivityLogGet-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-AzActivityLogAfter executing the above command, I got the below output

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 2After executing the above command, I got the expected output as shown in the screenshot below.

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:30After executing the above PowerShell command, I got the below-expected output

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 !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
