Skip to content

Commit

Permalink
Closes #3744 and #3753 (#3745)
Browse files Browse the repository at this point in the history
* updates

* Added the permissions set in the cmdlet and docs

* Update doc for #3753

* update

---------

Co-authored-by: Gautam Sheth <[email protected]>
  • Loading branch information
reshmee011 and gautamdsheth authored Feb 16, 2024
1 parent d5563d4 commit 907ba82
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
9 changes: 5 additions & 4 deletions documentation/Get-PnPUnifiedAuditLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ online version: https://pnp.github.io/powershell/cmdlets/Get-PnPUnifiedAuditLog.

**Required Permissions**

* Microsoft Office 365 Management API: ActivityFeed.Read
* Microsoft Office 365 Management API: ActivityFeed.Read, Microsoft Office 365 Management API: ActivityFeed.ReadDlp, Microsoft Office 365 Management API: ActivityReports.Read, Microsoft Office 365 Management API: ServiceHealth.Read and Microsoft Office 365 Management API:ThreatIntelligence.Read

Gets unified audit logs from the Office 365 Management API. Requires the Azure Active Directory application permission 'ActivityFeed.Read'.
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'.

## SYNTAX

Expand All @@ -40,6 +40,7 @@ Retrieves the audit logs of SharePoint happening between the current time yester
## PARAMETERS

### -ContentType

Content type of logs to be retrieved, should be one of the following: AzureActiveDirectory, Exchange, SharePoint, General, DLP.

```yaml
Expand All @@ -55,7 +56,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.
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).
```yaml
Type: DateTime
Expand All @@ -69,7 +70,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.
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).
```yaml
Type: DateTime
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ManagementApi/GetUnifiedAuditLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace PnP.PowerShell.Commands.ManagementApi
{
[Cmdlet(VerbsCommon.Get, "PnPUnifiedAuditLog")]
[RequiredMinimalApiPermissions("https://manage.office.com/ActivityFeed.Read")]
[RequiredMinimalApiPermissions("https://manage.office.com/ActivityFeed.Read","https://manage.office.com/ActivityFeed.ReadDlp","https://manage.office.com/ServiceHealth.Read","https://manage.office.com/ActivityReports.Read","https://manage.office.com/ThreatIntelligence.Read")]
[OutputType(typeof(ManagementApiUnifiedLogRecord))]
public class GetUnifiedAuditLog : PnPOfficeManagementApiCmdlet
{
Expand Down
40 changes: 40 additions & 0 deletions src/Commands/Resources/O365ManagementPermissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@
"consentDescription": "Allows the application to read service health information for your organization.",
"consentDisplayName": "Read service health information for your organization",
"value": "ServiceHealth.Read"
},
{
"adminConsentDescription": "Allows the application to read service health information for your organization.",
"adminConsentDisplayName": "Read activity reports for your organization",
"id": "b3b78c39-cb1d-4d17-820a-25d9196a800e",
"isEnabled": true,
"isAdmin": true,
"consentDescription": "Allows the application to read service health information for your organization.",
"consentDisplayName": "Read service health information for your organization",
"value": "ActivityReports.Read"
},
{
"adminConsentDescription": "Allows the application to read threat intelligence data for your organization",
"adminConsentDisplayName": "Read threat intelligence data for your organization",
"id": "17f1c501-83cd-414c-9064-cd10f7aef836",
"isEnabled": true,
"isAdmin": true,
"consentDescription": "Allows the application to read threat intelligence data for your organization",
"consentDisplayName": "Read threat intelligence data for your organization",
"value": "ThreatIntelligence.Read"
}
],
"applicationScopesList": [
Expand Down Expand Up @@ -61,6 +81,26 @@
"consentDescription": "Allows the application to read service health information for your organization.",
"consentDisplayName": "Read service health information for your organization",
"value": "ServiceHealth.Read"
},
{
"adminConsentDescription": "Allows the application to read service health information for your organization.",
"adminConsentDisplayName": "Read activity reports for your organization",
"id": "b3b78c39-cb1d-4d17-820a-25d9196a800e",
"isEnabled": true,
"isAdmin": true,
"consentDescription": "Allows the application to read service health information for your organization.",
"consentDisplayName": "Read service health information for your organization",
"value": "ActivityReports.Read"
},
{
"adminConsentDescription": "Allows the application to read threat intelligence data for your organization",
"adminConsentDisplayName": "Read threat intelligence data for your organization",
"id": "17f1c501-83cd-414c-9064-cd10f7aef836",
"isEnabled": true,
"isAdmin": true,
"consentDescription": "Allows the application to read threat intelligence data for your organization",
"consentDisplayName": "Read threat intelligence data for your organization",
"value": "ThreatIntelligence.Read"
}
]
}

0 comments on commit 907ba82

Please sign in to comment.