Skip to content

Commit be5620f

Browse files
authored
Merge pull request KelvinTegelaar#1524 from ngms-psh/createmissing-sp-tpss
Fix: Create missing SP RestrictThirdPartyStorageServices
2 parents 4f88eda + c3d65eb commit be5620f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardRestrictThirdPartyStorageServices.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function Invoke-CIPPStandardRestrictThirdPartyStorageServices {
5959
# Normal /servicePrincipal/AppId does not find the service principal, so gotta use the Upsert method. Also handles if the service principal does not exist nicely.
6060
# https://learn.microsoft.com/en-us/graph/api/serviceprincipal-upsert?view=graph-rest-beta&tabs=http
6161
$UpdateUri = "https://graph.microsoft.com/beta/servicePrincipals(appId='$AppId')"
62-
$null = New-GraphPostRequest -Uri $UpdateUri -Body $DisableBody -TenantID $Tenant -Type PATCH
62+
$null = New-GraphPostRequest -Uri $UpdateUri -Body $DisableBody -TenantID $Tenant -Type PATCH -AddedHeaders @{'Prefer' = 'create-if-missing'}
6363

6464
# Refresh the current state after disabling
6565
$CurrentState = New-GraphGetRequest -Uri $Uri -tenantid $Tenant | Select-Object displayName, accountEnabled, appId

0 commit comments

Comments
 (0)