Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Get-PnPUnifiedAuditLog Exception #1917

Open
ngazou opened this issue Oct 1, 2020 · 0 comments
Open

Get-PnPUnifiedAuditLog Exception #1917

ngazou opened this issue Oct 1, 2020 · 0 comments

Comments

@ngazou
Copy link

ngazou commented Oct 1, 2020

Hello,
I have an issue , when I am trying to retrieve the audit log from sharepoint by using Get-PnPUnifiedAuditLog

PowerShell code :

$SiteUrl = "https://MyTenant-admin.sharepoint.com"

$cnx = Connect-PnPOnlineWithDelegatedApp -SiteUrl $SiteUrl # connect with AAD app registration

$startDate = (Get-Date).AddDays(-1)
$endDate = (Get-Date)

$log = Get-PnPUnifiedAuditLog -StartTime $startDate -EndTime $endDate -ContentType SharePoint

Disconnect-PnPOnline

Exception

Get-PnPUnifiedAuditLog : Une exception de type 'PnP.PowerShell.Commands.Model.Teams.GraphException' a été levée.
Au caractère C:\transfert\script\KPMG.GEDLOOP.BackUpper\Main.PS1:19 : 8
+ $log = Get-PnPUnifiedAuditLog -StartTime $startDate -EndTime $endDate ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-PnPUnifiedAuditLog], GraphException
    + FullyQualifiedErrorId : PnP.PowerShell.Commands.Model.Teams.GraphException,PnP.PowerShell.Commands.ManagementApi.GetUnifiedAuditLog

image

AAD App Registration permissions

image

Used version of the PnP-PowerShell Cmdlets
PnP PowerShell for SharePoint Online

I need your help please.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant