File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ function Invoke-ExecCAExclusion {
1717 # If UserId is a guid, get the user's UPN
1818 $TenantFilter = $Request.Body.tenantFilter
1919 $UserID = $Request.Body.UserID
20+ $Username = $Request.Body.Username
2021 $Users = $Request.Body.Users
2122 $EndDate = $Request.Body.EndDate
2223 $PolicyId = $Request.Body.PolicyId
@@ -26,7 +27,7 @@ function Invoke-ExecCAExclusion {
2627 $UserID = $Users.value
2728 $Username = $Users.addedFields.userPrincipalName -join ' , '
2829 } else {
29- if ($UserID -match ' ^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$' ) {
30+ if ($UserID -match ' ^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$' -and -not $Username ) {
3031 $Username = (New-GraphGetRequest - uri " https://graph.microsoft.com/v1.0/users/$ ( $UserID ) " - tenantid $TenantFilter ).userPrincipalName
3132 }
3233 }
You can’t perform that action at this time.
0 commit comments