Skip to content

Commit

Permalink
Merge pull request #1237 from rvdwegen/patch-14
Browse files Browse the repository at this point in the history
Add Apple Business Manager terms alert
  • Loading branch information
KelvinTegelaar authored Jan 17, 2025
2 parents cecd2d5 + 44d0ffe commit 95d2571
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertAppleTerms.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Get-CIPPAlertAppleTerms {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)

# 0 = Expired
# 1 = expired?
# 2 = unknown
# 3 = Terms & Conditions
# 4 = Warning

try {
$appleterms = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/deviceManagement/depOnboardingSettings" -tenantid $TenantFilter
} catch {
return
}

if ($appleterms.lastSyncErrorCode -eq 3) {
$AlertData = "New Apple Business Manager terms are ready to accept."
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
}
}

0 comments on commit 95d2571

Please sign in to comment.