Skip to content

Commit 6c0a63b

Browse files
Fix: Enhance error logging in GDAP relationship creation to include line number and detailed JSON output for better diagnostics. (fallback in case write-logmessage doesn't capture it)
Synced from CyberDrain/CIPP@224f2de
1 parent 3a12077 commit 6c0a63b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecGDAPInvite.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function Invoke-ExecGDAPInvite {
106106
}
107107
} catch {
108108
$Message = 'Error creating GDAP relationship, failed at step: ' + $Step
109-
Write-Host "GDAP ERROR: $($_.InvocationInfo.PositionMessage)"
109+
Write-Information "GDAP ERROR: on line $($_.InvocationInfo.PositionMessage) | $(($_ | ConvertTo-Json -Compress))"
110110

111111
if ($Step -eq 'Creating GDAP relationship' -and $_.Exception.Message -match 'The user (principal) does not have the required permissions to perform the specified action on the resource.') {
112112
$Message = 'Error creating GDAP relationship, ensure that all users have MFA enabled and enforced without exception. Please see the Microsoft Partner Security Requirements documentation for more information. https://learn.microsoft.com/en-us/partner-center/security/partner-security-requirements'

0 commit comments

Comments
 (0)