pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

Get-PnPUnifiedAuditLog Error #2632

Closed AlexSen closed 4 years ago

AlexSen commented 4 years ago

Reporting an Issue or Missing Feature

Issue when trying to get audit logs via Get-PnPUnifiedAuditLog

Expected behavior

Get unified audit logs from the Office 365 Management API.

Actual behavior

Get-PnPUnifiedAuditLog : Exception while invoking endpoint https://manage.office.com/api/v1.0/<HiddenTenantId>/activity/feed/subscriptions/list.
At line:1 char:1
+ Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date). ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-PnPUnifiedAuditLog], ApplicationException
    + FullyQualifiedErrorId : System.ApplicationException,SharePointPnP.PowerShell.Commands.ManagementApi.GetUnifiedAuditLog

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

Azure App permisisons image

$PSDefaultParameterValues["Connect-PnPOnline:Tenant"] = "$TenantName.onmicrosoft.com"
$PSDefaultParameterValues["Connect-PnPOnline:ClientId"] = $AzAppClientId
$PSDefaultParameterValues["Connect-PnPOnline:Thumbprint"] = $CertificateAsset.Thumbprint

Connect-PnPOnline -Url "https://$TenantName-admin.sharepoint.com"
Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date).AddDays(-1) -EndTime (Get-Date).AddDays(-2) | Select -First 1

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

Name                          Version    
----                          -------    
SharePointPnPPowerShellOnline 3.20.2004.0
SharePointPnPPowerShellOnline 3.19.2003.0
SharePointPnPPowerShellOnline 3.18.2002.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

KoenZomers commented 4 years ago

I can reproduce this. Working on a fix for the May 2020 release.

KoenZomers commented 4 years ago

May 2020 has been released but it doesn't contain the fix yet due to personal circumstances of the repository owner. Please stick with March 2020 for now until the next PnP PowerShell release, which may still be in May. This is yet to be defined.

KoenZomers commented 4 years ago

The fix will be included in the June 2020 release which is expected on June 9th, 2020. Closing this issue assuming that will indeed resolve it. If it turns out the issue stil persists in the June 2020 release, feel free to reopen this issue.

AlexSen commented 4 years ago

Still same issue. Reproduced with same scenation. Could U check again from at side?