Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
ee0398d
feat(endpoint): add Apple ADE and Android enrollment profile listing …
kris6673 May 14, 2026
5ccf15a
fix: missing odata path error in the returned json
kris6673 May 14, 2026
5289a30
feat: ability to add/remove nested groups in group memberships
isgq-github01 May 15, 2026
7ae35c2
post exec tweaks for dedupe queue names
Zacgoose May 15, 2026
fd6e30f
fix(standards): target azureADRegistration in intuneRestrictUserDevic…
kris6673 May 15, 2026
c67bc8d
feat(standards): add intuneRestrictUserDeviceJoin standard
kris6673 May 15, 2026
90b6457
Add AutoExpandingArchiveScope property showing org-level vs mailbox-l…
Zacgoose May 18, 2026
ab83a2b
Update Update-CIPPSAMRedirectUri.ps1
Zacgoose May 18, 2026
d7cda8a
Update Initialize-CIPPAuth.ps1
Zacgoose May 18, 2026
ab5e515
Switch to app auth for authentication changes standard
Zacgoose May 18, 2026
1b1ee68
cache PowerShell enabled status and use cached data for standard
Zacgoose May 19, 2026
6b8ebd4
refactor calls to use new onepass method to store DB data
Zacgoose May 19, 2026
e3e82cd
Cache Security Defaults
Zacgoose May 19, 2026
9ba4871
correct incorrect default value
Zacgoose May 19, 2026
73f8371
add logging to geoip lookip
Zacgoose May 19, 2026
9fce7e7
feat: add in missing options for Windows Hello standard
kris6673 May 21, 2026
1e02bfc
feat(standards): add DLP via DCS standard
kris6673 May 21, 2026
cfa144d
Update Invoke-ListWorkerHealth.ps1
Zacgoose May 22, 2026
bb2ebc6
fix: Add missing options for Windows Hello standard (#2061)
KelvinTegelaar May 23, 2026
7fbb8ed
Feat: Split Intune device join and registration standards (#2057)
KelvinTegelaar May 23, 2026
77a4be6
fixes #6027
KelvinTegelaar May 23, 2026
4ab85c7
CIPP Hosted Notices
Zacgoose May 23, 2026
dcf382a
Update Build-DevApiModules.ps1
Zacgoose May 23, 2026
9bb2f6b
Update Build-DevApiModules.ps1
Zacgoose May 23, 2026
fa5f4de
remove sso setup from featureflag
JohnDuprey May 24, 2026
df84777
implement standards template deployment for intune apps
KelvinTegelaar May 24, 2026
08ab039
add filtering
KelvinTegelaar May 24, 2026
c81b6a5
add filtering
KelvinTegelaar May 24, 2026
33512c3
FIDO2 profile standards
KelvinTegelaar May 24, 2026
03abdad
add global var showing
KelvinTegelaar May 24, 2026
f09ce56
Update New-TeamsRequest.ps1
Zacgoose May 25, 2026
a0dab59
domain fixes
Zacgoose May 25, 2026
08b972c
timezone changes
Zacgoose May 25, 2026
d854e22
feat: add function to remove users from admin roles
kris6673 May 25, 2026
cb31997
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 25, 2026
46015ce
Add APv2 profile
KelvinTegelaar May 25, 2026
05ce60f
Feat: Add function to remove users from admin roles (#2064)
KelvinTegelaar May 25, 2026
a7e30d7
feat: Add DLP via DCS standard (#2062)
KelvinTegelaar May 25, 2026
4214bc7
Fix: Fix missing OData path error in JSON response (#2054)
KelvinTegelaar May 25, 2026
a7b7d4d
feat: Add Apple ADE and Android enrollment profile endpoints (#2053)
KelvinTegelaar May 25, 2026
443e16a
feat: ability to add/remove nested groups in group memberships (#2056)
KelvinTegelaar May 25, 2026
71afcdd
ExoTransportConfig cache type - fix for missing data used in test suites
Zacgoose May 26, 2026
1e63ebf
Update Invoke-CIPPStandardsharingDomainRestriction.ps1
Zacgoose May 26, 2026
59a0e15
update application content type handling
Zacgoose May 26, 2026
e6b800b
remove rerun from alert
Zacgoose May 26, 2026
97dc672
user sync
Zacgoose May 26, 2026
359633a
fix: ensure tenant groups skips cache so they dont alternate anymore …
kris6673 May 26, 2026
49d629e
Update Get-CippApiAuth.ps1
Zacgoose May 26, 2026
22902b0
api fixes
Zacgoose May 26, 2026
5561a5b
Fix: tenant groups cache issue (#2065)
KelvinTegelaar May 26, 2026
95d48d1
Fix for desktop activations copilot ready test
Zacgoose May 27, 2026
a6fdfe2
Make all tenants list for SPO sites fast
Zacgoose May 27, 2026
122aec8
fix for template id casing
Zacgoose May 27, 2026
7d3b480
Update Invoke-CIPPStandardDefenderCompliancePolicy.ps1
Zacgoose May 27, 2026
4915301
use top 500 to minimise requests
Zacgoose May 27, 2026
c5b0e59
smart lockout standard
KelvinTegelaar May 27, 2026
c5a8a20
smart lockout standard
KelvinTegelaar May 27, 2026
f85963b
Sharepoint management functionality.
KelvinTegelaar May 27, 2026
b7d4f5e
Sharepoint management functionality.
KelvinTegelaar May 27, 2026
b7c7218
fix: update terminology from "Temporary Access Password" to "Temporar…
kris6673 May 27, 2026
8a536fe
Fix: Update terminology from "Temporary Access Password" to "Temporar…
KelvinTegelaar May 27, 2026
bdd8602
Add version cleanup
KelvinTegelaar May 27, 2026
e563aea
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 27, 2026
829ced8
feat(mailboxes): cache mailbox and archive usage metrics
kris6673 May 27, 2026
0ebb188
implement autopatch
KelvinTegelaar May 27, 2026
e41d532
Update Add-CIPPDbItem.ps1
Zacgoose May 28, 2026
5b7c5a9
Update Invoke-ListWorkerHealth.ps1
Zacgoose May 28, 2026
aefa69b
add compliance admin by default
KelvinTegelaar May 28, 2026
25fcdc1
add 404 detection for non-existing roles
KelvinTegelaar May 28, 2026
25e2b0f
tweaks
Zacgoose May 28, 2026
99dd88c
optimisation
Zacgoose May 28, 2026
0cdc2e8
new auth methods single standard
KelvinTegelaar May 28, 2026
fc080e4
new auth methods single standard
KelvinTegelaar May 28, 2026
a1179a2
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 28, 2026
55fea61
Feat: Add online archive report functionality for mailboxes (#2067)
KelvinTegelaar May 28, 2026
1f9fb1f
test invocation optimisations
Zacgoose May 28, 2026
3f03634
Update Initialize-CIPPAuth.ps1
Zacgoose May 29, 2026
e0f45f2
Backup excluded tenants config
Zacgoose May 29, 2026
e3d57cf
Update Invoke-CIPPStandardDeployCheckChromeExtension.ps1
Zacgoose May 29, 2026
a17137c
chore: remove cipp processor queue
JohnDuprey May 29, 2026
0fd3315
chore: disable cippcommand action
JohnDuprey May 29, 2026
e98445f
chore: sanitize cippid in public webhooks
JohnDuprey May 29, 2026
38e3ae9
chore: block arbitrary cmdlets not in CIPP modules
JohnDuprey May 29, 2026
c18bda8
fix: optimize checks
JohnDuprey May 29, 2026
c69e2ce
fix: allow for command without .value
JohnDuprey May 29, 2026
da7bd8c
chore: add devsecrets to restricted tables
JohnDuprey May 29, 2026
2ed3f94
chore: remove write host
JohnDuprey May 29, 2026
f5f3736
Optimize CIPP DB orchestration
Zacgoose May 30, 2026
7caadb2
fixes
Zacgoose May 30, 2026
11e613a
cleanup
Zacgoose May 30, 2026
dd8952e
reduce memory
Zacgoose May 30, 2026
518855c
test optimisation
Zacgoose May 30, 2026
7b34160
update openapi spec with generated one
KelvinTegelaar May 31, 2026
4478065
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar May 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions Config/CIPPDBCacheTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,5 +363,10 @@
"type": "CopilotUserCountTrend",
"friendlyName": "Copilot User Count Trend",
"description": "Daily Copilot active user count trend (7-day period)"
},
{
"type": "ExoTransportConfig",
"friendlyName": "Exchange Transport Config",
"description": "Exchange Online transport configuration including SMTP authentication settings"
}
]
17 changes: 9 additions & 8 deletions Config/CIPPTimers.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
"RunOnProcessor": true,
"PreferredProcessor": "usertasks"
},
{
"Id": "168decf3-7ddd-471e-ab46-8b40be0f18ae",
"Command": "Start-CIPPProcessorQueue",
"Description": "Timer to handle user initiated tasks",
"Cron": "0 */15 * * * *",
"Priority": 1,
"RunOnProcessor": true
},
{
"Id": "44a40668-ed71-403c-8c26-b32e320086ad",
"Command": "Start-AuditLogOrchestrator",
Expand Down Expand Up @@ -273,5 +265,14 @@
"Priority": 30,
"RunOnProcessor": false,
"IsSystem": true
},
{
"Id": "7e2a9b4c-1d5f-4a8e-b3c6-0f9d2e7a4b1c",
"Command": "Start-UserSyncTimer",
"Description": "Sync partner tenant users and group-based roles into allowedUsers table",
"Cron": "0 */15 * * * *",
"Priority": 11,
"RunOnProcessor": false,
"IsSystem": true
}
]
7 changes: 4 additions & 3 deletions Config/FeatureFlags.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@
"Endpoints": [
"ExecCIPPUsers",
"ListCIPPUsers",
"ExecSSOSetup",
"ExecContainerManagement",
"ListContainerLogs"
"ListContainerLogs",
"ListWorkerHealth"
],
"Pages": [
"/cipp/advanced/super-admin/cipp-users",
"/cipp/advanced/super-admin/sso",
"/cipp/advanced/super-admin/container",
"/cipp/advanced/container-logs"
"/cipp/advanced/container-logs",
"/cipp/advanced/worker-health"
],
"Hidden": true
}
Expand Down
109 changes: 83 additions & 26 deletions Config/standards.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ function Push-UploadApplication {
$Filter = "PartitionKey eq 'apps' and RowKey eq '$($Item.Name)'"

$AppConfig = (Get-CIPPAzDataTableEntity @Table -filter $Filter).JSON | ConvertFrom-Json
$intuneBody = $AppConfig.IntuneBody
$tenants = if ($AppConfig.tenant -eq 'AllTenants') {
(Get-Tenants -IncludeErrors).defaultDomainName
} else {
$AppConfig.tenant
}
$assignTo = $AppConfig.assignTo
$AssignToIntent = $AppConfig.InstallationIntent
$ExcludeGroup = $AppConfig.excludeGroup
$ClearRow = Get-CIPPAzDataTableEntity @Table -Filter $Filter
if ($AppConfig.tenant -ne 'AllTenants') {
$null = Remove-AzDataTableEntity -Force @Table -Entity $clearRow
Expand All @@ -33,142 +29,9 @@ function Push-UploadApplication {
}
}

# Determine app type (default to 'Choco' if not specified)
$AppType = if ($AppConfig.type) { $AppConfig.type } else { 'Choco' }

# Load files based on app type (only for types that need them)
$Intunexml = $null
$Infile = $null
if ($AppType -eq 'MSPApp') {
[xml]$Intunexml = Get-Content (Join-Path $env:CIPPRootPath "AddMSPApp\$($AppConfig.MSPAppName).app.xml")
$Infile = Join-Path $env:CIPPRootPath "AddMSPApp\$($AppConfig.MSPAppName).intunewin"
} elseif ($AppType -in @('Choco', 'Win32ScriptApp')) {
[xml]$Intunexml = Get-Content (Join-Path $env:CIPPRootPath 'AddChocoApp\Choco.App.xml')
$Infile = Join-Path $env:CIPPRootPath "AddChocoApp\$($Intunexml.ApplicationInfo.FileName)"
}


$baseuri = 'https://graph.microsoft.com/beta/deviceAppManagement/mobileApps'
foreach ($tenant in $tenants) {
try {
# Check if app already exists
$ApplicationList = New-GraphGetRequest -Uri $baseuri -tenantid $tenant | Where-Object { $_.DisplayName -eq $AppConfig.Applicationname -and ($_.'@odata.type' -eq '#microsoft.graph.win32LobApp' -or $_.'@odata.type' -eq '#microsoft.graph.winGetApp') }
if ($ApplicationList.displayname.count -ge 1) {
Write-LogMessage -api 'AppUpload' -tenant $tenant -message "$($AppConfig.Applicationname) exists. Skipping this application" -Sev 'Info'
continue
}

# Route to appropriate handler based on app type
$NewApp = $null
switch ($AppType) {
'WinGet' {
$NewApp = Add-CIPPWinGetApp -AppBody $intuneBody -TenantFilter $tenant
}
'Choco' {
# Prepare encryption info from XML
$EncryptionInfo = @{
EncryptionKey = $Intunexml.ApplicationInfo.EncryptionInfo.EncryptionKey
MacKey = $Intunexml.ApplicationInfo.EncryptionInfo.MacKey
InitializationVector = $Intunexml.ApplicationInfo.EncryptionInfo.InitializationVector
Mac = $Intunexml.ApplicationInfo.EncryptionInfo.Mac
ProfileIdentifier = $Intunexml.ApplicationInfo.EncryptionInfo.ProfileIdentifier
FileDigest = $Intunexml.ApplicationInfo.EncryptionInfo.FileDigest
FileDigestAlgorithm = $Intunexml.ApplicationInfo.EncryptionInfo.FileDigestAlgorithm
}

# Build parameters dynamically
$Params = @{
AppBody = $intuneBody
TenantFilter = $tenant
FilePath = $Infile
FileName = $Intunexml.ApplicationInfo.FileName
UnencryptedSize = [int64]$Intunexml.ApplicationInfo.UnencryptedContentSize
EncryptionInfo = $EncryptionInfo
}
if ($AppConfig.Applicationname) { $Params.DisplayName = $AppConfig.Applicationname }

$NewApp = Add-CIPPPackagedApplication @Params
}
'MSPApp' {
# Prepare encryption info from XML
$EncryptionInfo = @{
EncryptionKey = $Intunexml.ApplicationInfo.EncryptionInfo.EncryptionKey
MacKey = $Intunexml.ApplicationInfo.EncryptionInfo.MacKey
InitializationVector = $Intunexml.ApplicationInfo.EncryptionInfo.InitializationVector
Mac = $Intunexml.ApplicationInfo.EncryptionInfo.Mac
ProfileIdentifier = $Intunexml.ApplicationInfo.EncryptionInfo.ProfileIdentifier
FileDigest = $Intunexml.ApplicationInfo.EncryptionInfo.FileDigest
FileDigestAlgorithm = $Intunexml.ApplicationInfo.EncryptionInfo.FileDigestAlgorithm
}

# Build parameters dynamically
$Params = @{
AppBody = $intuneBody
TenantFilter = $tenant
FilePath = $Infile
FileName = $Intunexml.ApplicationInfo.FileName
UnencryptedSize = [int64]$Intunexml.ApplicationInfo.UnencryptedContentSize
EncryptionInfo = $EncryptionInfo
}
if ($AppConfig.Applicationname) { $Params.DisplayName = $AppConfig.Applicationname }

$NewApp = Add-CIPPPackagedApplication @Params
}
'Win32ScriptApp' {
# Prepare encryption info from XML
$EncryptionInfo = @{
EncryptionKey = $Intunexml.ApplicationInfo.EncryptionInfo.EncryptionKey
MacKey = $Intunexml.ApplicationInfo.EncryptionInfo.MacKey
InitializationVector = $Intunexml.ApplicationInfo.EncryptionInfo.InitializationVector
Mac = $Intunexml.ApplicationInfo.EncryptionInfo.Mac
ProfileIdentifier = $Intunexml.ApplicationInfo.EncryptionInfo.ProfileIdentifier
FileDigest = $Intunexml.ApplicationInfo.EncryptionInfo.FileDigest
FileDigestAlgorithm = $Intunexml.ApplicationInfo.EncryptionInfo.FileDigestAlgorithm
}

# Build properties dynamically
$Properties = @{
displayName = $AppConfig.Applicationname
installScript = $AppConfig.installScript
}

# A few of these are probably mandatory
if ($AppConfig.description) { $Properties['description'] = $AppConfig.description }
if ($AppConfig.publisher) { $Properties['publisher'] = $AppConfig.publisher }
if ($AppConfig.uninstallScript) { $Properties['uninstallScript'] = $AppConfig.uninstallScript }
if ($AppConfig.detectionScript) { $Properties['detectionScript'] = $AppConfig.detectionScript }
if ($AppConfig.detectionPath) { $Properties['detectionPath'] = $AppConfig.detectionPath }
if ($AppConfig.detectionFile) { $Properties['detectionFile'] = $AppConfig.detectionFile }
if ($AppConfig.runAsAccount) { $Properties['runAsAccount'] = $AppConfig.runAsAccount }
if ($AppConfig.deviceRestartBehavior) { $Properties['deviceRestartBehavior'] = $AppConfig.deviceRestartBehavior }
if ($null -ne $AppConfig.runAs32Bit) { $Properties['runAs32Bit'] = $AppConfig.runAs32Bit }
if ($null -ne $AppConfig.enforceSignatureCheck) { $Properties['enforceSignatureCheck'] = $AppConfig.enforceSignatureCheck }

$NewApp = Add-CIPPW32ScriptApplication -TenantFilter $tenant -Properties ([PSCustomObject]$Properties)
}
'WinGetNew' {
# I think we don't need a separate WinGetNew type, just use WinGet?
}
default {
throw "Unsupported app type: $($AppConfig.type)"
}
}

# Log success and assign app if requested
if ($NewApp) {
Write-LogMessage -api 'AppUpload' -tenant $tenant -message "$($AppConfig.Applicationname) Successfully created" -Sev 'Info'

if ($assignTo -and $assignTo -ne 'On') {
$intent = if ($AssignToIntent) { 'Uninstall' } else { 'Required' }
$AppTypeForAssignment = switch ($AppType) {
'WinGet' { 'WinGet' }
'WinGetNew' { 'WinGet' }
default { 'Win32Lob' }
}
Start-Sleep -Milliseconds 200
Set-CIPPAssignedApplication -ApplicationId $NewApp.Id -TenantFilter $tenant -groupName $assignTo -ExcludeGroup $ExcludeGroup -Intent $intent -AppType $AppTypeForAssignment -APIName 'AppUpload'
}
}
$NewApp = New-CIPPIntuneAppDeployment -AppConfig $AppConfig -TenantFilter $tenant -APIName 'AppUpload'
} catch {
"Failed to add Application for $tenant : $($_.Exception.Message)"
Write-LogMessage -api 'AppUpload' -tenant $tenant -message "Failed adding Application $($AppConfig.Applicationname). Error: $($_.Exception.Message)" -LogData (Get-CippException -Exception $_) -Sev 'Error'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Push-BPACollectData {
#>
param($Item)

$TenantName = Get-Tenants | Where-Object -Property defaultDomainName -EQ $Item.Tenant
$TenantName = Get-Tenants -TenantFilter $Item.Tenant
$BPATemplateTable = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'BPATemplate'"
$TemplatesLoc = (Get-CIPPAzDataTableEntity @BPATemplateTable -Filter $Filter).JSON | ConvertFrom-Json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ function Push-ExecCIPPDBCache {

# Build the full function name
$FullFunctionName = "Set-CIPPDBCache$Name"

# Check if function exists
$Function = Get-Command -Name $FullFunctionName -ErrorAction SilentlyContinue
if (-not $Function) {
throw "Function $FullFunctionName does not exist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function Push-DomainAnalyserTenant {
}

if ($OldDomain) {
$DomainObject.DkimSelectors = $OldDomain.DkimSelectors
$DomainObject.MailProviders = $OldDomain.MailProviders
$Domain.DkimSelectors = $OldDomain.DkimSelectors
$Domain.MailProviders = $OldDomain.MailProviders
}
} else {
$Domain.TenantDetails = $TenantDetails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ function Push-GetTenantDomains {
Param($Item)
$DomainTable = Get-CippTable -tablename 'Domains'
$Filter = "PartitionKey eq 'TenantDomains' and TenantGUID eq '{0}'" -f $Item.TenantGUID
$Domains = Get-CIPPAzDataTableEntity @DomainTable -Filter $Filter -Property PartitionKey, RowKey | Select-Object RowKey, @{n = 'FunctionName'; exp = { 'DomainAnalyserDomain' } }
$Domains = Get-CIPPAzDataTableEntity @DomainTable -Filter $Filter -Property PartitionKey, RowKey, TenantId | Select-Object RowKey, @{n = 'FunctionName'; exp = { 'DomainAnalyserDomain' } }, @{n = 'TenantFilter'; exp = { $_.TenantId } }
return @($Domains)
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ function Push-CIPPDBCacheApplyBatch {
Write-Information "Aggregated $($AllTasks.Count) cache tasks from all tenants"

# Start a single flat orchestrator to execute all cache tasks
$TenantSuffix = if ($Item.Parameters.TenantFilter) { "_$($Item.Parameters.TenantFilter)" } else { '' }
$InputObject = [PSCustomObject]@{
OrchestratorName = 'CIPPDBCacheExecute'
OrchestratorName = "CIPPDBCacheExecute$TenantSuffix"
Batch = @($AllTasks)
SkipLog = $true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ function Push-ExecScheduledCommand {
}
}

if ($Item.Command -in (Get-CIPPSchedulerBlockedCommands)) {
$Results = "Task blocked: '$($Item.Command)' is not permitted to run as a scheduled task."
$Command = Get-Command -Name $Item.Command -ErrorAction SilentlyContinue
if ($null -eq $Command) {
$Results = "Task Failed: The command $($Item.Command) does not exist."
$State = 'Failed'
Write-LogMessage -API 'Scheduler_UserTasks' -tenant $Tenant -tenantid $TenantInfo.customerId -message "Blocked execution of restricted command '$($Item.Command)' in task $($task.Name)" -sev Warning
if (!$IsMultiTenantExecution) {
Update-AzDataTableEntity -Force @Table -Entity @{
PartitionKey = $task.PartitionKey
Expand All @@ -173,14 +173,16 @@ function Push-ExecScheduledCommand {
TaskState = $State
}
}

Write-LogMessage -API 'Scheduler_UserTasks' -tenant $Tenant -tenantid $TenantInfo.customerId -message "Failed to execute task $($task.Name): The command $($Item.Command) does not exist." -sev Error
Remove-Variable -Name ScheduledTaskId -Scope Script -ErrorAction SilentlyContinue
return
}

$Function = Get-Command -Name $Item.Command
if ($null -eq $Function) {
$Results = "Task Failed: The command $($Item.Command) does not exist."
if ($Command.Module -notin @('CIPPCore', 'CIPPAlerts', 'CIPPStandards', 'CIPPTests', 'CIPPDB')) {
$State = 'Failed'
Write-LogMessage -headers $Headers -API 'ScheduledTask' -message "Blocked attempt to schedule command from unauthorized module: $($Command.ModuleName)\$($Item.Command)" -Sev 'Warning'
$Results = "Task blocked: The command '$($Item.Command)' is not permitted to run as a scheduled task."
if (!$IsMultiTenantExecution) {
Update-AzDataTableEntity -Force @Table -Entity @{
PartitionKey = $task.PartitionKey
Expand All @@ -189,11 +191,26 @@ function Push-ExecScheduledCommand {
TaskState = $State
}
}

Write-LogMessage -API 'Scheduler_UserTasks' -tenant $Tenant -tenantid $TenantInfo.customerId -message "Failed to execute task $($task.Name): The command $($Item.Command) does not exist." -sev Error
Remove-Variable -Name ScheduledTaskId -Scope Script -ErrorAction SilentlyContinue
return
}
if ($Item.Command -in (Get-CIPPSchedulerBlockedCommands)) {
$Results = "Task blocked: '$($Item.Command)' is not permitted to run as a scheduled task."
$State = 'Failed'
Write-LogMessage -API 'Scheduler_UserTasks' -tenant $Tenant -tenantid $TenantInfo.customerId -message "Blocked execution of restricted command '$($Item.Command)' in task $($task.Name)" -sev Warning
if (!$IsMultiTenantExecution) {
Update-AzDataTableEntity -Force @Table -Entity @{
PartitionKey = $task.PartitionKey
RowKey = $task.RowKey
Results = "$Results"
TaskState = $State
}
}
Remove-Variable -Name ScheduledTaskId -Scope Script -ErrorAction SilentlyContinue
return
}

$Function = $Command

try {
$PossibleParams = $Function.Parameters.Keys
Expand Down
Loading