@@ -7,7 +7,7 @@ function New-CIPPBackupTask {
77
88 $BackupData = switch ($Task ) {
99 ' CippCustomVariables' {
10- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' CustomVariables ' - Execute {
10+ Measure-CippTask - TaskName ' CustomVariables ' - EventName ' CIPP.BackupCompleted ' - Script {
1111 $ReplaceTable = Get-CIPPTable - tablename ' CippReplacemap'
1212
1313 # Get tenant-specific variables
@@ -26,7 +26,7 @@ function New-CIPPBackupTask {
2626 }
2727 }
2828 ' users' {
29- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' Users ' - Execute {
29+ Measure-CippTask - TaskName ' Users ' - EventName ' CIPP.BackupCompleted ' - Script {
3030 $Users = New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/users?$top=999' - tenantid $TenantFilter | Select-Object * - ExcludeProperty mail, provisionedPlans, onPrem* , * passwordProfile* , * serviceProvisioningErrors* , isLicenseReconciliationNeeded, isManagementRestricted, isResourceAccount, * date* , * external* , identities, deletedDateTime, isSipEnabled, assignedPlans, cloudRealtimeCommunicationInfo, deviceKeys, provisionedPlan, securityIdentifier
3131 # remove the property if the value is $null
3232 $users = $Users | ForEach-Object {
@@ -38,12 +38,12 @@ function New-CIPPBackupTask {
3838 }
3939 }
4040 ' groups' {
41- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' Groups ' - Execute {
41+ Measure-CippTask - TaskName ' Groups ' - EventName ' CIPP.BackupCompleted ' - Script {
4242 New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/groups?$top=999' - tenantid $TenantFilter
4343 }
4444 }
4545 ' ca' {
46- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' ConditionalAccess ' - Execute {
46+ Measure-CippTask - TaskName ' ConditionalAccess ' - EventName ' CIPP.BackupCompleted ' - Script {
4747 $Policies = New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/conditionalAccess/policies?$top=999' - tenantid $TenantFilter - AsApp $true
4848 foreach ($policy in $policies ) {
4949 try {
@@ -55,7 +55,7 @@ function New-CIPPBackupTask {
5555 }
5656 }
5757 ' intuneconfig' {
58- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' IntuneConfiguration ' - Execute {
58+ Measure-CippTask - TaskName ' IntuneConfiguration ' - EventName ' CIPP.BackupCompleted ' - Script {
5959 $GraphURLS = @ (" https://graph.microsoft.com/beta/deviceManagement/deviceConfigurations?`$ select=id,displayName,lastModifiedDateTime,roleScopeTagIds,microsoft.graph.unsupportedDeviceConfiguration/originalEntityTypeName&`$ expand=assignments&top=1000"
6060 ' https://graph.microsoft.com/beta/deviceManagement/windowsDriverUpdateProfiles'
6161 " https://graph.microsoft.com/beta/deviceManagement/groupPolicyConfigurations?`$ expand=assignments&top=999"
@@ -85,23 +85,23 @@ function New-CIPPBackupTask {
8585 }
8686 }
8787 ' intunecompliance' {
88- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' IntuneCompliance ' - Execute {
88+ Measure-CippTask - TaskName ' IntuneCompliance ' - EventName ' CIPP.BackupCompleted ' - Script {
8989 New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/deviceManagement/deviceCompliancePolicies?$top=999' - tenantid $TenantFilter | ForEach-Object {
9090 New-CIPPIntuneTemplate - TenantFilter $TenantFilter - URLName ' deviceCompliancePolicies' - ID $_.ID
9191 }
9292 }
9393 }
9494
9595 ' intuneprotection' {
96- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' IntuneProtection ' - Execute {
96+ Measure-CippTask - TaskName ' IntuneProtection ' - EventName ' CIPP.BackupCompleted ' - Script {
9797 New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/deviceAppManagement/managedAppPolicies?$top=999' - tenantid $TenantFilter | ForEach-Object {
9898 New-CIPPIntuneTemplate - TenantFilter $TenantFilter - URLName ' managedAppPolicies' - ID $_.ID
9999 }
100100 }
101101 }
102102
103103 ' antispam' {
104- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' AntiSpam ' - Execute {
104+ Measure-CippTask - TaskName ' AntiSpam ' - EventName ' CIPP.BackupCompleted ' - Script {
105105 $Policies = New-ExoRequest - tenantid $Tenantfilter - cmdlet ' Get-HostedContentFilterPolicy' | Select-Object * - ExcludeProperty * odata* , * data .type*
106106 $Rules = New-ExoRequest - tenantid $Tenantfilter - cmdlet ' Get-HostedContentFilterRule' | Select-Object * - ExcludeProperty * odata* , * data .type*
107107
@@ -122,7 +122,7 @@ function New-CIPPBackupTask {
122122 }
123123
124124 ' antiphishing' {
125- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' AntiPhishing ' - Execute {
125+ Measure-CippTask - TaskName ' AntiPhishing ' - EventName ' CIPP.BackupCompleted ' - Script {
126126 $Policies = New-ExoRequest - tenantid $Tenantfilter - cmdlet ' Get-AntiPhishPolicy' | Select-Object * - ExcludeProperty * odata* , * data .type*
127127 $Rules = New-ExoRequest - tenantid $Tenantfilter - cmdlet ' Get-AntiPhishRule' | Select-Object * - ExcludeProperty * odata* , * data .type*
128128
@@ -143,13 +143,13 @@ function New-CIPPBackupTask {
143143 }
144144
145145 ' CippWebhookAlerts' {
146- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' WebhookAlerts ' - Execute {
146+ Measure-CippTask - TaskName ' WebhookAlerts ' - EventName ' CIPP.BackupCompleted ' - Script {
147147 $WebhookTable = Get-CIPPTable - TableName ' WebhookRules'
148148 Get-CIPPAzDataTableEntity @WebhookTable | Where-Object { $TenantFilter -in ($_.Tenants | ConvertFrom-Json ).value }
149149 }
150150 }
151151 ' CippScriptedAlerts' {
152- Measure-CIPPTask - Name ' CIPP.BackupCompleted ' - Section ' ScriptedAlerts ' - Execute {
152+ Measure-CippTask - TaskName ' ScriptedAlerts ' - EventName ' CIPP.BackupCompleted ' - Script {
153153 $ScheduledTasks = Get-CIPPTable - TableName ' ScheduledTasks'
154154 Get-CIPPAzDataTableEntity @ScheduledTasks | Where-Object { $_.hidden -eq $true -and $_.command -like ' Get-CippAlert*' -and $TenantFilter -in $_.Tenant }
155155 }
0 commit comments