Audit file deletions in SharePoint and OneDrive

Audit file deletions in SharePoint and OneDrive
This commit is contained in:
AdminDroid 2023-09-28 12:38:52 +05:30
parent d22e1da069
commit 21aee896ad

View File

@ -30,11 +30,11 @@ Param
Function Connect_Exo Function Connect_Exo
{ {
#Check for EXO v2 module inatallation #Check for EXO module inatallation
$Module = Get-Module ExchangeOnlineManagement -ListAvailable $Module = Get-Module ExchangeOnlineManagement -ListAvailable
if($Module.count -eq 0) if($Module.count -eq 0)
{ {
Write-Host Exchange Online PowerShell V2 module is not available -ForegroundColor yellow Write-Host Exchange Online PowerShell module is not available -ForegroundColor yellow
$Confirm= Read-Host Are you sure you want to install module? [Y] Yes [N] No $Confirm= Read-Host Are you sure you want to install module? [Y] Yes [N] No
if($Confirm -match "[yY]") if($Confirm -match "[yY]")
{ {
@ -43,7 +43,7 @@ Function Connect_Exo
} }
else else
{ {
Write-Host EXO V2 module is required to connect Exchange Online.Please install module using Install-Module ExchangeOnlineManagement cmdlet. Write-Host EXO module is required to connect Exchange Online.Please install module using Install-Module ExchangeOnlineManagement cmdlet.
Exit Exit
} }
} }
@ -144,7 +144,7 @@ $ProcessedAuditCount=0
$OutputEvents=0 $OutputEvents=0
$ExportResult="" $ExportResult=""
$ExportResults=@() $ExportResults=@()
$RetriveOperation="FileDeleted,FileDeletedFirstStageRecycleBin,FileDeletedSecondStageRecycleBin" $RetriveOperation="FileDeleted,FileDeletedFirstStageRecycleBin,FileDeletedSecondStageRecycleBin,FileRecycled"
#Checking whether the user is available #Checking whether the user is available
#if(($FilesDeletedBy.Length -ne 0) -and ((Get-Mailbox -Identity $Mailbox) -eq $null)) #if(($FilesDeletedBy.Length -ne 0) -and ((Get-Mailbox -Identity $Mailbox) -eq $null))