Skip to content

Commit

Permalink
Update Auditlog docs.Closes #3753 (#3785)
Browse files Browse the repository at this point in the history
* Updating the docs to specify that start and end time needs to be UTC

* Update audit log docs

* update docs
  • Loading branch information
reshmee011 authored Feb 23, 2024
1 parent b3176d5 commit f112d74
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions documentation/Get-PnPUnifiedAuditLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f112d74

Please sign in to comment.