Skip to main content

directory_audits

Creates, updates, deletes, gets or lists a directory_audits resource.

Overview

Namedirectory_audits
TypeResource
Identra_id.audit_logs.directory_audits

Fields

The following fields are returned by SELECT queries:

Retrieved navigation property

NameDatatypeDescription
idstringThe unique identifier for an entity. Read-only.
activityDateTimestring (date-time)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. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$)
activityDisplayNamestringIndicates 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).
additionalDetailsarrayIndicates additional details on the activity.
categorystringIndicates 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.
correlationIdstringIndicates a unique ID that helps correlate activities that span across various services. Can be used to trace logs across services. Supports $filter (eq).
initiatedByobject (title: auditActivityInitiator)
loggedByServicestringIndicates 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).
operationTypestringIndicates the type of operation that was performed. The possible values include but are not limited to the following: Add, Assign, Update, Unassign, and Delete.
resultIndicates the result of the activity. The possible values are: success, failure, timeout, unknownFutureValue.
resultReasonstringIndicates the reason for failure if the result is failure or timeout.
targetResourcesarrayIndicates 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdirectory_audit_idGet a specific Microsoft Entra audit log item. This includes an audit log item generated by various services within Microsoft Entra ID like user, application, device and group management, privileged identity management (PIM), access reviews, terms of use, identity protection, password management (self-service and admin password resets), self-service group management, and so on.
listselectGet the list of audit logs generated by Microsoft Entra ID. This includes audit logs generated by various services within Microsoft Entra ID, including user, app, device and group Management, privileged identity management (PIM), access reviews, terms of use, identity protection, password management (self-service and admin password resets), and self- service group management, and so on.
insertinsert
updateupdatedirectory_audit_id
deletedeletedirectory_audit_idIf-Match

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
directory_audit_idstringThe unique identifier of directoryAudit
If-MatchstringETag

SELECT examples

Get a specific Microsoft Entra audit log item. This includes an audit log item generated by various services within Microsoft Entra ID like user, application, device and group management, privileged identity management (PIM), access reviews, terms of use, identity protection, password management (self-service and admin password resets), self-service group management, and so on.

SELECT
id,
activityDateTime,
activityDisplayName,
additionalDetails,
category,
correlationId,
initiatedBy,
loggedByService,
operationType,
result,
resultReason,
targetResources
FROM entra_id.audit_logs.directory_audits
WHERE directory_audit_id = '{{ directory_audit_id }}' -- required
;

INSERT examples

No description available.

INSERT INTO entra_id.audit_logs.directory_audits (
id,
activityDateTime,
activityDisplayName,
additionalDetails,
category,
correlationId,
initiatedBy,
loggedByService,
operationType,
result,
resultReason,
targetResources
)
SELECT
'{{ id }}',
'{{ activityDateTime }}',
'{{ activityDisplayName }}',
'{{ additionalDetails }}',
'{{ category }}',
'{{ correlationId }}',
'{{ initiatedBy }}',
'{{ loggedByService }}',
'{{ operationType }}',
'{{ result }}',
'{{ resultReason }}',
'{{ targetResources }}'
RETURNING
id,
activityDateTime,
activityDisplayName,
additionalDetails,
category,
correlationId,
initiatedBy,
loggedByService,
operationType,
result,
resultReason,
targetResources
;

UPDATE examples

No description available.

UPDATE entra_id.audit_logs.directory_audits
SET
id = '{{ id }}',
activityDateTime = '{{ activityDateTime }}',
activityDisplayName = '{{ activityDisplayName }}',
additionalDetails = '{{ additionalDetails }}',
category = '{{ category }}',
correlationId = '{{ correlationId }}',
initiatedBy = '{{ initiatedBy }}',
loggedByService = '{{ loggedByService }}',
operationType = '{{ operationType }}',
result = '{{ result }}',
resultReason = '{{ resultReason }}',
targetResources = '{{ targetResources }}'
WHERE
directory_audit_id = '{{ directory_audit_id }}' --required
RETURNING
id,
activityDateTime,
activityDisplayName,
additionalDetails,
category,
correlationId,
initiatedBy,
loggedByService,
operationType,
result,
resultReason,
targetResources;

DELETE examples

No description available.

DELETE FROM entra_id.audit_logs.directory_audits
WHERE directory_audit_id = '{{ directory_audit_id }}' --required
AND If-Match = '{{ If-Match }}'
;