Skip to content

Commit

Permalink
CA policy tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Jan 7, 2025
1 parent 5b3b68c commit 0971049
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ Function Invoke-ListConditionalAccessPolicies {
displayName = $cap.displayName
customer = $cap.Customer
tenantID = $cap.TenantID
createdDateTime = $(if (![string]::IsNullOrEmpty($cap.createdDateTime)) { [datetime]$cap.createdDateTime | Get-Date -Format 'yyyy-MM-dd HH:mm' }else { '' })
modifiedDateTime = $(if (![string]::IsNullOrEmpty($cap.modifiedDateTime)) { [datetime]$cap.modifiedDateTime | Get-Date -Format 'yyyy-MM-dd HH:mm' }else { '' })
createdDateTime = $(if (![string]::IsNullOrEmpty($cap.createdDateTime)) { [datetime]$cap.createdDateTime } else { '' })
modifiedDateTime = $(if (![string]::IsNullOrEmpty($cap.modifiedDateTime)) { [datetime]$cap.modifiedDateTime }else { '' })
state = $cap.state
clientAppTypes = ($cap.conditions.clientAppTypes) -join ','
includePlatforms = ($cap.conditions.platforms.includePlatforms) -join ','
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Invoke-RemoveCAPolicy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Function Invoke-RemoveCAPolicy {
$policyId = $Request.Query.GUID
if (!$policyId) { exit }
try {
$null = New-GraphPostRequest -uri "https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies/$($policyId)" -type DELETE -tenant $TenantFilter
$null = New-GraphPostRequest -uri "https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies/$($policyId)" -type DELETE -tenant $TenantFilter -asapp $true
Write-LogMessage -user $User -API $APINAME -message "Deleted CA Policy $policyId" -Sev 'Info' -tenant $TenantFilter
$body = [pscustomobject]@{'Results' = 'Successfully deleted the policy' }

Expand Down

0 comments on commit 0971049

Please sign in to comment.