You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -53,7 +53,7 @@ function Invoke-ExecExchangeRoleRepair {
53
53
state='success'
54
54
resultText="Successfully repaired the missing Organization Management roles: $($MissingOrgMgmtRoles.displayName-join', ')"
55
55
}
56
-
Write-LogMessage-headers $Headers-tenant $Tenant.defaultDomainName-tenantid $Tenant.customerId-Message "Successfully repaired the missing Organization Management roles: $($MissingOrgMgmtRoles.displayName-join', '). Run another Tenant Access check after waiting a bit for replication."-sev 'Info'
56
+
Write-LogMessage-API 'ExecExchangeRoleRepair'-headers $Headers-tenant $Tenant.defaultDomainName-tenantid $Tenant.customerId-Message "Successfully repaired the missing Organization Management roles: $($MissingOrgMgmtRoles.displayName-join', '). Run another Tenant Access check after waiting a bit for replication."-sev 'Info'
@@ -65,11 +65,13 @@ function Invoke-ExecExchangeRoleRepair {
65
65
if ($RepairResults.status-in (401,403,500)) {
66
66
$PermissionError=$true
67
67
}
68
+
$LogData=$RepairResults|Select-Object-Property id, status, body
68
69
$Results=@{
69
70
state='error'
70
71
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'" })"
71
72
}
72
-
Write-LogMessage-headers $Headers-tenant $Tenant.defaultDomainName-tenantid $Tenant.customerId-Message "Failed to repair the missing Organization Management roles: $($FailedRoles-join', ')"-sev 'Error'
73
+
Write-LogMessage-API 'ExecExchangeRoleRepair'-headers $Headers-tenant $Tenant.defaultDomainName-tenantid $Tenant.customerId-Message "Failed to repair the missing Organization Management roles: $($FailedRoles-join', ')"-sev 'Error'-LogData $LogData
74
+
Write-Warning'Exchange role repair failed'
73
75
}
74
76
} else {
75
77
$Results=@{
@@ -80,7 +82,7 @@ function Invoke-ExecExchangeRoleRepair {
80
82
} catch {
81
83
$ErrorMessage=Get-CippException-Exception $_
82
84
Write-Warning"Exception during Exchange Organization Management role repair: $($ErrorMessage.NormalizedError)"
0 commit comments