Skip to content

Commit 99787a0

Browse files
exclude sharepoint admin center deviations
1 parent 83d182d commit 99787a0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Modules/CIPPCore/Public/Get-CIPPDrift.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,11 @@ function Get-CIPPDrift {
424424

425425
# Check for extra Conditional Access policies not in template
426426
foreach ($TenantCAPolicy in $TenantCAPolicies) {
427+
# SharePoint auto-creates '[SharePoint admin center]...' CA policies when unmanaged
428+
# device access is restricted (Set-SPOTenant -ConditionalAccessPolicy, e.g. via the
429+
# unmanagedSync standard). They are system-managed, cannot be templated and come
430+
# back when deleted, so they are never a deviation.
431+
if (([string]$TenantCAPolicy.displayName).StartsWith('[SharePoint admin center]')) { continue }
427432
$PolicyFound = $false
428433

429434
foreach ($TemplateCAPolicy in $TemplateCATemplates) {

0 commit comments

Comments
 (0)