Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Recipient Provisioning investigation initial file template #117

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
32 changes: 32 additions & 0 deletions ActionPlans/Start-RecipientProvisioningInvestigation.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Function Search-RecipientObject
{
param(
[int][Parameter(Mandatory=$true)] $DaysToSearch,
[string[]][Parameter(Mandatory=$false)] $OperationsToSearch,
[string][Parameter(Mandatory=$false)] $userIds)

$DaysToSearch=10
if (!([string]::IsNullOrEmpty($userIds)))
{
$UnifiedAuditLogs = Search-UnifiedAuditLog -StartDate (Get-Date).addDays(-$DaysToSearch) -EndDate (Get-Date) -Operations $OperationsToSearch - -UserIds $userIds -SessionCommand ReturnLargeSet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the unneccessary "-" from the command:
"$OperationsToSearch - -UserIds $userIds" should be "$OperationsToSearch -UserIds $userIds"

}
else
{
$UnifiedAuditLogs = Search-UnifiedAuditLog -StartDate (Get-Date).addDays(-$DaysToSearch) -EndDate (Get-Date) -Operations $OperationsToSearch -SessionCommand ReturnLargeSet
}

return $UnifiedAuditLogs

}


Clear-Host
$Workloads = "exo", "msol"
Connect-O365PS $Workloads
$CurrentProperty = "Connecting to: $Workloads"
$CurrentDescription = "Success"
write-log -Function "Connecting to O365 workloads" -Step $CurrentProperty -Description $CurrentDescription
$ts= get-date -Format yyyyMMdd_HHmmss
$ExportPath = "$global:WSPath\RecipientProvisioningInvestigation_$ts"
mkdir $ExportPath -Force |out-null