Skip to content

Commit 907ba82

Browse files
Closes #3744 and #3753 (#3745)
* updates * Added the permissions set in the cmdlet and docs * Update doc for #3753 * update --------- Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>
1 parent d5563d4 commit 907ba82

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed

documentation/Get-PnPUnifiedAuditLog.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ online version: https://pnp.github.io/powershell/cmdlets/Get-PnPUnifiedAuditLog.
1313

1414
**Required Permissions**
1515

16-
* Microsoft Office 365 Management API: ActivityFeed.Read
16+
* 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
1717

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

2020
## SYNTAX
2121

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

4242
### -ContentType
43+
4344
Content type of logs to be retrieved, should be one of the following: AzureActiveDirectory, Exchange, SharePoint, General, DLP.
4445

4546
```yaml
@@ -55,7 +56,7 @@ Accept wildcard characters: False
5556
```
5657
5758
### -EndTime
58-
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.
59+
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).
5960
6061
```yaml
6162
Type: DateTime
@@ -69,7 +70,7 @@ Accept wildcard characters: False
6970
```
7071
7172
### -StartTime
72-
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.
73+
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).
7374
7475
```yaml
7576
Type: DateTime

src/Commands/ManagementApi/GetUnifiedAuditLog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace PnP.PowerShell.Commands.ManagementApi
1212
{
1313
[Cmdlet(VerbsCommon.Get, "PnPUnifiedAuditLog")]
14-
[RequiredMinimalApiPermissions("https://manage.office.com/ActivityFeed.Read")]
14+
[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")]
1515
[OutputType(typeof(ManagementApiUnifiedLogRecord))]
1616
public class GetUnifiedAuditLog : PnPOfficeManagementApiCmdlet
1717
{

src/Commands/Resources/O365ManagementPermissions.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@
2929
"consentDescription": "Allows the application to read service health information for your organization.",
3030
"consentDisplayName": "Read service health information for your organization",
3131
"value": "ServiceHealth.Read"
32+
},
33+
{
34+
"adminConsentDescription": "Allows the application to read service health information for your organization.",
35+
"adminConsentDisplayName": "Read activity reports for your organization",
36+
"id": "b3b78c39-cb1d-4d17-820a-25d9196a800e",
37+
"isEnabled": true,
38+
"isAdmin": true,
39+
"consentDescription": "Allows the application to read service health information for your organization.",
40+
"consentDisplayName": "Read service health information for your organization",
41+
"value": "ActivityReports.Read"
42+
},
43+
{
44+
"adminConsentDescription": "Allows the application to read threat intelligence data for your organization",
45+
"adminConsentDisplayName": "Read threat intelligence data for your organization",
46+
"id": "17f1c501-83cd-414c-9064-cd10f7aef836",
47+
"isEnabled": true,
48+
"isAdmin": true,
49+
"consentDescription": "Allows the application to read threat intelligence data for your organization",
50+
"consentDisplayName": "Read threat intelligence data for your organization",
51+
"value": "ThreatIntelligence.Read"
3252
}
3353
],
3454
"applicationScopesList": [
@@ -61,6 +81,26 @@
6181
"consentDescription": "Allows the application to read service health information for your organization.",
6282
"consentDisplayName": "Read service health information for your organization",
6383
"value": "ServiceHealth.Read"
84+
},
85+
{
86+
"adminConsentDescription": "Allows the application to read service health information for your organization.",
87+
"adminConsentDisplayName": "Read activity reports for your organization",
88+
"id": "b3b78c39-cb1d-4d17-820a-25d9196a800e",
89+
"isEnabled": true,
90+
"isAdmin": true,
91+
"consentDescription": "Allows the application to read service health information for your organization.",
92+
"consentDisplayName": "Read service health information for your organization",
93+
"value": "ActivityReports.Read"
94+
},
95+
{
96+
"adminConsentDescription": "Allows the application to read threat intelligence data for your organization",
97+
"adminConsentDisplayName": "Read threat intelligence data for your organization",
98+
"id": "17f1c501-83cd-414c-9064-cd10f7aef836",
99+
"isEnabled": true,
100+
"isAdmin": true,
101+
"consentDescription": "Allows the application to read threat intelligence data for your organization",
102+
"consentDisplayName": "Read threat intelligence data for your organization",
103+
"value": "ThreatIntelligence.Read"
64104
}
65105
]
66106
}

0 commit comments

Comments
 (0)