Skip to content

Commit 1051a2c

Browse files
Work so far
1 parent 87fb051 commit 1051a2c

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-ExecUpdateDriftDeviation.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ function Invoke-ExecUpdateDriftDeviation {
3838
result = $Result
3939
}
4040
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Updated drift deviation status for $($Deviation.standardName) to $($Deviation.status)" -Sev 'Info'
41+
if ($Deviation.status -eq 'DeniedRemediate') {
42+
$Setting = $Deviation.standardName -replace 'standards.', ''
43+
$StandardTemplate = Get-CIPPTenantAlignment -TenantFilter $TenantFilter | Where-Object -Property standardType -EQ 'drift'
44+
$StandardTemplate = $StandardTemplate.$Setting
45+
$StandardTemplate.action = @(
46+
@{label = 'Report'; value = 'Report' },
47+
@{ label = 'Remediate'; value = 'Remediate' }
48+
)
49+
#idea here is to make a system job that triggers the remediation process, so that users can click on "Deniedremediate"
50+
#That job then launches a single standard run, it gets the same input as an orch, but is just a scheduled job.
51+
52+
}
53+
if ($Deviation.status -eq 'deniedDelete') {
54+
#Here we look at the policy ID received and the type, and nuke it.
55+
}
4156
} catch {
4257
[PSCustomObject]@{
4358
standardName = $Deviation.standardName

Modules/CIPPCore/Public/Get-CIPPDrift.ps1

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,6 @@ function Get-CIPPDrift {
188188
$TenantCAPolicies = @()
189189
}
190190

191-
# Always update cache with fresh data
192-
try {
193-
$CacheTable = Get-CippTable -tablename 'cacheDrift'
194-
$IntuneJsonString = "`"$($TenantIntunePolicies | ConvertTo-Json -Depth 10 -Compress | ForEach-Object { $_ -replace '"', '\"' })`""
195-
$CAJsonString = "`"$($TenantCAPolicies | ConvertTo-Json -Depth 10 -Compress | ForEach-Object { $_ -replace '"', '\"' })`""
196-
197-
$CacheEntity = @{
198-
PartitionKey = 'drift'
199-
RowKey = $TenantFilter
200-
IntuneJson = $IntuneJsonString
201-
CAJson = $CAJsonString
202-
}
203-
Add-CIPPAzDataTableEntity @CacheTable -Entity $CacheEntity -Force
204-
} catch {
205-
Write-Warning "Failed to cache policy data: $($_.Exception.Message)"
206-
}
207191
}
208192

209193
if ($Alignment.standardSettings) {

Modules/CIPPCore/Public/Set-CIPPDriftDeviation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Set-CIPPDriftDeviation {
2727
[string]$StandardName,
2828

2929
[Parameter(Mandatory = $true)]
30-
[ValidateSet('Accepted', 'New', 'Denied', 'CustomerSpecific')]
30+
[ValidateSet('Accepted', 'New', 'Denied', 'CustomerSpecific', 'DeniedRemediate', 'DeniedDelete')]
3131
[string]$Status
3232
)
3333

0 commit comments

Comments
 (0)