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
Improve CA policy location and service exception handling
Refactored location processing in New-CIPPCATemplate to reduce redundant API calls and ensure unique location info. Enhanced Set-CIPPCAPolicyServiceException with clearer logic, improved string handling, and added more informative logging. Minor bug fixes and code style improvements in Invoke-ExecCAServiceExclusion and New-CIPPCAPolicy for robustness.
$Body=@{ Results="Failed to add service provider exception to policy $($ID): $($ErrorMessage.NormalizedError)" }
24
24
Write-LogMessage-headers $Headers-API 'Set-CIPPCAPolicyServiceException'-message "Failed to update policy $($PolicyId) with service provider exception for tenant $($CSPtenantId): $($_.Exception.Message)"-Sev 'Error'-tenant $TenantFilter-LogData (Get-CippException-Exception $_)
# If guestOrExternalUserTypes includes type serviceProvider and membershipKind is not all tenants
64
-
if ($policy.conditions.users.excludeGuestsOrExternalUsers.guestOrExternalUserTypes-match"serviceProvider"-AND$policy.conditions.users.excludeGuestsOrExternalUsers.externalTenants.membershipKind-ne"all") {
64
+
if ($policy.conditions.users.excludeGuestsOrExternalUsers.guestOrExternalUserTypes-match'serviceProvider'-and$policy.conditions.users.excludeGuestsOrExternalUsers.externalTenants.membershipKind-ne'all') {
65
65
66
66
# If membershipKind is enumerated and members does not include our tenant add it
67
-
if ($policy.conditions.users.excludeGuestsOrExternalUsers.externalTenants.membershipKind-eq"enumerated"-AND$policy.conditions.users.excludeGuestsOrExternalUsers.externalTenants.members-notmatch$CSPtenantId) {
67
+
if ($policy.conditions.users.excludeGuestsOrExternalUsers.externalTenants.membershipKind-eq'enumerated'-and$policy.conditions.users.excludeGuestsOrExternalUsers.externalTenants.members-notmatch$CSPtenantId) {
0 commit comments