Skip to content

Commit fb9819c

Browse files
updates for ca disablement
1 parent 4397a3c commit fb9819c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional/Invoke-AddCAPolicy.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-AddCAPolicy {
3+
function Invoke-AddCAPolicy {
44
<#
55
.FUNCTIONALITY
66
Entrypoint
@@ -19,7 +19,7 @@ Function Invoke-AddCAPolicy {
1919

2020
$results = foreach ($Tenant in $tenants) {
2121
try {
22-
$CAPolicy = New-CIPPCAPolicy -replacePattern $Request.Body.replacename -Overwrite $request.Body.overwrite -TenantFilter $Tenant -state $Request.Body.NewState -RawJSON $Request.Body.RawJSON -APIName $APIName -Headers $Headers
22+
$CAPolicy = New-CIPPCAPolicy -replacePattern $Request.Body.replacename -Overwrite $request.Body.overwrite -TenantFilter $Tenant -state $Request.Body.NewState -DisableSD $Request.Body.DisableSD -RawJSON $Request.Body.RawJSON -APIName $APIName -Headers $Headers
2323
"$CAPolicy"
2424
} catch {
2525
"$($_.Exception.Message)"

Modules/CIPPCore/Public/New-CIPPCAPolicy.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ function New-CIPPCAPolicy {
231231
$body = '{ "isEnabled": false }'
232232
$null = New-GraphPostRequest -tenantid $tenant -Uri 'https://graph.microsoft.com/beta/policies/identitySecurityDefaultsEnforcementPolicy' -Type patch -Body $body -ContentType 'application/json'
233233
Write-LogMessage -Headers $User -API $APINAME -tenant $($Tenant) -message "Disabled Security Defaults for tenant $($TenantFilter)" -Sev 'Info'
234+
Start-Sleep 3
234235
}
235236
$RawJSON = ConvertTo-Json -InputObject $JSONObj -Depth 10 -Compress
236237
Write-Information $RawJSON

0 commit comments

Comments
 (0)