
This article will discuss how to get sign-in logs in Azure Active Directory using the PowerShell command Get-AzureADAuditSignInLogs and how to fix the error Get-AzureADAuditSignInLogs not recognized that I got while executing this command.
Get-AzureADAuditSignInLogs is not recognized
Get-AzureADAuditSignInLogs
Get-AzureADAuditSignInLogs is an excellent Azure PowerShell cmdlet that can help you retrieve the sign-in logs in Azure Active Directory. Let’s discuss the syntax of the Get-AzureADAuditSignInLogs Azure PowerShell cmdlet with examples.
Syntax
Get-AzureADAuditSignInLogsIf you want to add any filter condition, you can use the syntax like this.
Get-AzureADAuditSignInLogs -Filter "fliter condition as a string"Example:
Below, the Azure PowerShell cmdlet will get you the sign-in logs from your Azure Active Directory.
Get-AzureADAuditSignInLogsAfter executing the above Azure PowerShell cmdlet, I got the below error
“Get-AzureADAuditSignInLogs: The term ‘Get-AzureADAuditSignInLogs’ is not recognized
as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and
try again.”
Below is the complete error message
Get-AzureADAuditSignInLogs : The term 'Get-AzureADAuditSignInLogs' is not recognized
as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ Get-AzureADAuditSignInLogs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureADAuditSignInLogs:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptionYou can see it here.

Get-azureadauditsigninlogs’ is not recognized as the name of a cmdlet [Solution]
To solve the error “get-azureadauditsigninlogs’ is not recognized as the name of a cmdlet”, I followed the below steps.
- Uninstall the Azure AD module using the below PowerShell cmdlet.
Uninstall-Module azureadNow, install the AzureADPreview module using the below PowerShell cmdlet.
Install-Module AzureADPreview
After installing the AzureADPreview module, I reran the Get-AzureADAuditSignInLogs Azure PowerShell cmdlet. But this time, I got the error
Get-AzureADAuditSignInLogs : You must call the Connect-AzureAD cmdlet before calling
any other cmdlets.

So, I tried running the Connect-AzureAD followed by the Get-AzureADAuditSignInLogs Azure PowerShell cmdlet.
Connect-AzureAD
Get-AzureADAuditSignInLogsAfter executing the Get-AzureADAuditSignInLogs, a few people are getting the below error, and this error is because of a lack of MSGraph permissions.
Get-AzureADAuditSignInLogs : Error occurred while executing GetAuditSignInLogs
Code: Authentication_MSGraphPermissionMissing
Message: Calling principal does not have required MSGraph permissions
The complete error message is
Get-AzureADAuditSignInLogs : Error occurred while executing GetAuditSignInLogs
Code: Authentication_MSGraphPermissionMissing
Message: Calling principal does not have required MSGraph permissions
AuditLog.Read.All
InnerError:
RequestId: 51b5d58d-3362-4535-9281-b503783f5647
DateTimeStamp: Fri, 09 Sep 2022 12:06:46 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
At line:2 char:1
- Get-AzureADAuditSignInLogs
~~~~~~- CategoryInfo : NotSpecified: (:) [Get-AzureADAuditSignInLogs], ApiExce
ption - FullyQualifiedErrorId: Microsoft.Open.MSGraphBeta.Client.ApiException,Microsof
t.Open.MSGraphBeta.PowerShell.GetAuditSignInLogs
- CategoryInfo : NotSpecified: (:) [Get-AzureADAuditSignInLogs], ApiExce
You can see it here

If you are getting the above error, follow this article to solve this error.
You may also like following the articles below
- How to get tenant ID in Azure using PowerShell
- How to create and add members to Azure Active Directory Group
Final Words
In this article, we discussed how to get sign-in logs in Azure Active Directory using PowerShell and Azure Portal. Thanks for reading this article.
