File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,10 @@ function Push-UpdatePermissionsQueue {
2727 Add-CIPPDelegatedPermission - RequiredResourceAccess ' CIPPDefaults' - ApplicationId $ENV: ApplicationID - tenantfilter $Item.customerId
2828 Write-LogMessage - tenant $Item.defaultDomainName - tenantId $Item.customerId - message " Updated permissions for $ ( $Item.displayName ) " - Sev ' Info' - API ' UpdatePermissionsQueue'
2929
30- Write-Information ' Pushing CIPP-SAM admin roles'
31- Set-CIPPSAMAdminRoles - TenantFilter $Item.customerId
30+ if ($Item.defaultDomainName -ne ' PartnerTenant' ) {
31+ Write-Information ' Pushing CIPP-SAM admin roles'
32+ Set-CIPPSAMAdminRoles - TenantFilter $Item.customerId
33+ }
3234
3335 $Table = Get-CIPPTable - TableName cpvtenants
3436 $unixtime = [int64 ](([datetime ]::UtcNow) - (Get-Date ' 1/1/1970' )).TotalSeconds
Original file line number Diff line number Diff line change @@ -8,7 +8,24 @@ function Start-UpdatePermissionsOrchestrator {
88
99 try {
1010 Write-Information ' Updating Permissions'
11- $Tenants = Get-Tenants - IncludeAll | Where-Object { $_.customerId -ne $env: TenantID -and $_.Excluded -eq $false }
11+
12+ $PartnerTenant = @ {
13+ ' customerId' = $env: TenantID
14+ ' defaultDomainName' = ' PartnerTenant'
15+ ' displayName' = ' *Partner Tenant'
16+ }
17+
18+ $TenantList = Get-Tenants - IncludeAll | Where-Object { $_.Excluded -eq $false }
19+
20+ $Tenants = [System.Collections.Generic.List [object ]]::new()
21+ foreach ($Tenant in $TenantList ) {
22+ $Tenants.Add ($Tenant )
23+ }
24+
25+ if ($Tenants.customerId -notcontains $env: TenantID ) {
26+ $Tenants.Add ($PartnerTenant )
27+ }
28+
1229 $CPVTable = Get-CIPPTable - TableName cpvtenants
1330 $CPVRows = Get-CIPPAzDataTableEntity @CPVTable
1431 $LastCPV = ($CPVRows | Sort-Object - Property Timestamp - Descending | Select-Object - First 1 ).Timestamp.DateTime
Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ function New-ExoRequest {
6666 if ($cmdlet -in ' Set-AdminAuditLogConfig' ) {
6767 $MailboxGuid = ' 8cc370d3-822a-4ab8-a926-bb94bd0641a9'
6868 }
69- $anchor = " APP:SystemMailbox{$MailboxGuid }@$ ( $tenant.customerId ) "
69+ if ($Compliance.IsPresent ) {
70+ $Anchor = " UPN:SystemMailbox{$MailboxGuid }@$ ( $tenant.initialDomainName ) "
71+ } else {
72+ $anchor = " APP:SystemMailbox{$MailboxGuid }@$ ( $tenant.customerId ) "
73+ }
7074 }
7175 # if the anchor is a GUID, try looking up the user.
7276 if ($Anchor -match ' ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' ) {
You can’t perform that action at this time.
0 commit comments