diff --git a/documentation/Get-PnPUnifiedAuditLog.md b/documentation/Get-PnPUnifiedAuditLog.md index 9c22235a8..b62d23611 100644 --- a/documentation/Get-PnPUnifiedAuditLog.md +++ b/documentation/Get-PnPUnifiedAuditLog.md @@ -17,6 +17,12 @@ online version: https://pnp.github.io/powershell/cmdlets/Get-PnPUnifiedAuditLog. Gets unified audit logs from the Office 365 Management API. Requires the Azure Entra application permission 'ActivityFeed.Read', 'ActivityFeed.ReadDlp', 'ActivityReports.Read', 'ServiceHealth.Read' and 'ThreatIntelligence.Read'. +Before you can access audit log data, you must enable unified audit logging for your Microsoft 365 tenant. For instructions, check out the page [Turn auditing on or off](https://learn.microsoft.com/microsoft-365/compliance/audit-log-enable-disable). + +When running this command for the first time for a certain content type, a subscription for this content type is created. It can take up to 12 hours for the first content blobs to become available for that subscription. + +Retrieving audit logs is an intensive process, especially for large or active tenants. In this case it may take some time to retrieve all audit logs. + ## SYNTAX ```powershell @@ -32,7 +38,7 @@ Allows to retrieve unified audit logs from the Office 365 Management API. ### EXAMPLE 1 ```powershell -Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date).AddDays(-2) -EndTime (Get-Date).AddDays(-1) +Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date -asUtc).AddDays(-2) -EndTime (Get-Date -asUtc).AddDays(-1) ``` Retrieves the audit logs of SharePoint happening between the current time yesterday and the current time the day before yesterday @@ -56,7 +62,7 @@ Accept wildcard characters: False ``` ### -EndTime -End time of logs to be retrieved. Start time and end time must both be specified (or both omitted) and must be less than or equal to 24 hours apart. If passed as a string this should be defined as a valid ISO 8601 string (2024-01-16T18:28:48.6964197Z). +UTC end time of logs to be retrieved. Start time and end time must both be specified (or both omitted) and must be less than or equal to 24 hours apart. If passed as a string this should be defined as a valid ISO 8601 string (2024-01-16T18:28:48.6964197Z). If you don't include a timestamp in the value, the default timestamp is 12:00 AM (midnight) on the specified date. ```yaml Type: DateTime @@ -70,7 +76,7 @@ Accept wildcard characters: False ``` ### -StartTime -Start time of logs to be retrieved. Start time and end time must both be specified (or both omitted) and must be less than or equal to 24 hours apart, with the start time prior to end time and start time no more than 7 days in the past. If passed as a string this should be defined as a valid ISO 8601 string (2024-01-16T18:28:48.6964197Z). +UTC start time of logs to be retrieved. Start time and end time must both be specified (or both omitted) and must be less than or equal to 24 hours apart, with the start time prior to end time and start time no more than 7 days in the past. If passed as a string this should be defined as a valid ISO 8601 string (2024-01-16T18:28:48.6964197Z). If you don't include a timestamp in the value, the default timestamp is 12:00 AM (midnight) on the specified date. ```yaml Type: DateTime