AuditLog.Read.All
Allows the app to read and query your audit log activities, without a signed-in user.
Permission Details
Read all audit log data
Allows the app to read and query your audit log activities, without a signed-in user.
b0afded3-3588-46d8-8b3d-9842eff778da
Read audit log data
Allows the app to read and query your audit log activities, on behalf of the signed-in user.
e4c9e354-4dc5-45b8-9e7c-e1393b0b1a20
Properties
Properties is shown from stable Microsoft Graph v1.0 metadata.
| Property | Type | Description |
|---|---|---|
activityDateTime |
DateTimeOffset |
Indicates the date and time the activity was performed. The Timestamp type is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Supports $filter (eq, ge, le) and $orderby. |
activityDisplayName |
String |
Indicates the activity name or the operation name (examples: "Create User" and "Add member to group"). For a list of activities logged, refer to Microsoft Entra audit log categories and activities. Supports $filter (eq, startswith). |
additionalDetails |
keyValue collection |
Indicates additional details on the activity. |
category |
String |
Indicates which resource category that's targeted by the activity. For example: UserManagement, GroupManagement, ApplicationManagement, RoleManagement. For a list of categories for activities logged, refer to Microsoft Entra audit log categories and activities. |
correlationId |
GuidNullable |
Indicates a unique ID that helps correlate activities that span across various services. Can be used to trace logs across services. Supports $filter (eq). |
id |
String |
Indicates the unique ID for the activity. This is a GUID. Supports $filter (eq). |
initiatedBy |
auditActivityInitiator |
Indicates information about the user or app initiated the activity. Supports $filter (eq) for user/id, user/displayName, user/userPrincipalName, app/appId, app/displayName; and $filter (startswith) for user/userPrincipalName. |
loggedByService |
StringNullable |
Indicates information on which service initiated the activity (For example: Self-service Password Management, Core Directory, B2C, Invited Users, Microsoft Identity Manager, Privileged Identity Management. Supports $filter (eq). |
operationType |
StringNullable |
Indicates the type of operation that was performed. The possible values include but are not limited to the following: Add, Assign, Update, Unassign, and Delete. |
result |
operationResult |
Indicates the result of the activity. The possible values are: success, failure, timeout, unknownFutureValue. |
resultReason |
StringNullable |
Indicates the reason for failure if the result is failure or timeout. |
targetResources |
targetResource collection |
Indicates information on which resource was changed due to the activity. Target Resource Type can be User, Device, Directory, App, Role, Group, Policy or Other. Supports $filter (eq) for id and displayName; and $filter (startswith) for displayName. |
JSON Representation
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"activityDateTime": "String (timestamp)",
"activityDisplayName": "String",
"additionalDetails": [
{
"@odata.type": "microsoft.graph.keyValue"
}
],
"category": "String",
"correlationId": "Guid",
"id": "String (identifier)",
"initiatedBy": {
"@odata.type": "microsoft.graph.auditActivityInitiator"
},
"loggedByService": "String",
"operationType": "String",
"result": "String",
"resultReason": "String",
"targetResources": [
{
"@odata.type": "microsoft.graph.targetResource"
}
]
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
additionalDetails |
keyValue collection |
Indicates additional details on the activity. |
initiatedBy |
auditActivityInitiator |
Related initiatedBy data exposed by this resource. |
targetResources |
targetResource collection |
Indicates information on which resource was changed due to the activity. Target Resource Type can be User, Device, Directory, App, Role, Group, Policy or Other. Supports $filter (eq) for id and displayName; and $filter (startswith) for displayName. |
Graph Methods
Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.
Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.
Code Examples
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.AuditLogs.DirectoryAudits["{directoryAudit-id}"].GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let userRegistrationFeatureSummary = await client.api('/reports/authenticationMethods/usersRegisteredByFeature(includedUserTypes='all',includedUserRoles='all')')
.get();
Import-Module Microsoft.Graph.Reports
Get-MgAuditLogDirectoryAudit -DirectoryAuditId $directoryAuditId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.audit_logs.directory_audits.by_directory_audit_id('directoryAudit-id').get()
App Registration
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions or delegated permissions and search for AuditLog.Read.All
Grant Admin Consent
Application permissions always require admin consent.