Skip to content

Commit d40c2bc

Browse files
committed
Update Invoke-ExecExchangeRoleRepair.ps1
1 parent dda5502 commit d40c2bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecExchangeRoleRepair.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function Invoke-ExecExchangeRoleRepair {
3737
method = 'POST'
3838
url = 'roleManagement/exchange/roleAssignments'
3939
body = @{
40-
principalId = $Group.Guid
40+
principalId = $Group.ExternalDirectoryObjectId
4141
roleDefinitionId = $Role.id
4242
directoryScopeId = '/'
4343
appScopeId = $null
@@ -66,8 +66,8 @@ function Invoke-ExecExchangeRoleRepair {
6666
$PermissionError = $false
6767
if ($RepairResults.status -in (401, 403, 500)) {
6868
$PermissionError = $true
69-
$LogData = $RepairResults | Where-Object { $_.status -in (401, 403, 500) } | Select-Object -Property id, status, body
7069
}
70+
$LogData = $RepairResults | Where-Object { $_.status -in (401, 403, 500) } | Select-Object -Property id, status, body
7171
$Results = @{
7272
state = 'error'
7373
resultText = "Failed to repair the missing Organization Management roles: $($FailedRoles -join ', ').$(if ($PermissionError) { " This may be due to insufficient permissions. The required Graph Permission is 'Application - RoleManagement.ReadWrite.Exchange'" })"

0 commit comments

Comments
 (0)