File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Modules/CIPPCore/Public/Alerts Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,18 @@ function Get-CIPPAlertEntraConnectSyncStatus {
2020 $LastPasswordSync = $ConnectSyncStatus.onPremisesLastPasswordSyncDateTime
2121 $SyncDateTime = $ConnectSyncStatus.onPremisesLastSyncDateTime
2222 # Get the older of the two sync times
23- $LastSync = if ($SyncDateTime -lt $LastPasswordSync ) { $SyncDateTime } else { $LastPasswordSync }
23+ $LastSync = if ($SyncDateTime -lt $LastPasswordSync ) { $SyncDateTime ; $Cause = ' DirectorySync ' } else { $LastPasswordSync ; $Cause = ' PasswordSync ' }
2424
2525 if ($LastSync -lt (Get-Date ).AddHours(- $Hours ).ToUniversalTime()) {
26- $AlertData = " Entra Connect Sync for $ ( $TenantFilter ) has not run for over $Hours hours. Last sync was at $ ( $LastSync.ToString (' o' )) "
26+
27+ $AlertData = @ {
28+ Message = " Entra Connect $Cause for $ ( $TenantFilter ) has not run for over $Hours hours. Last sync was at $ ( $LastSync.ToString (' o' )) "
29+ LastSync = $LastSync
30+ Cause = $Cause
31+ LastPasswordSync = $LastPasswordSync
32+ LastDirectorySync = $SyncDateTime
33+ Tenant = $TenantFilter
34+ }
2735 Write-AlertTrace - cmdletName $MyInvocation.MyCommand - tenantFilter $TenantFilter - data $AlertData
2836 }
2937 }
You can’t perform that action at this time.
0 commit comments