@@ -155,8 +155,8 @@ function Push-AuditLogIngestion {
155155
156156 if ($StateEntity -and $StateEntity.LastContentCreatedUtc ) { $StartTime = ([DateTime ]$StateEntity.LastContentCreatedUtc ).AddMinutes(-5 ).ToUniversalTime() } else { $StartTime = $Now.AddHours (-1 ).ToUniversalTime() }
157157 $EndTime = $Now.AddMinutes (-5 ).ToUniversalTime()
158- $StartTimeStr = $StartTime.ToString (' yyyy-MM-ddTHH:mm:ss.fffZ ' )
159- $EndTimeStr = $EndTime.ToString (' yyyy-MM-ddTHH:mm:ss.fffZ ' )
158+ $StartTimeStr = $StartTime.ToString (' yyyy-MM-ddTHH:mm:ss' )
159+ $EndTimeStr = $EndTime.ToString (' yyyy-MM-ddTHH:mm:ss' )
160160 Write-LogMessage - API ' AuditLogIngestion' - tenant $TenantFilter - message " Polling $ContentType from $StartTimeStr to $EndTimeStr " - sev Debug
161161 $ContentUri = " https://manage.office.com/api/v1.0/$TenantId /activity/feed/subscriptions/content?contentType=$ContentType &startTime=$StartTimeStr &endTime=$EndTimeStr "
162162 $ContentParams = @ {
@@ -180,7 +180,7 @@ function Push-AuditLogIngestion {
180180 continue
181181 }
182182 Write-LogMessage - API ' AuditLogIngestion' - tenant $TenantFilter - message " Found $ ( $ContentList.Count ) content blobs for $ContentType " - sev Info
183-
183+
184184 $SwFilter = [System.Diagnostics.Stopwatch ]::StartNew()
185185 $NewContentItems = if ($StateEntity -and $StateEntity.LastContentId ) {
186186 $LastContentCreated = [DateTime ]$StateEntity.LastContentCreatedUtc
@@ -285,19 +285,19 @@ function Push-AuditLogIngestion {
285285 }
286286 }
287287 $StateUpdates [$ContentType ].SubscriptionEnabled = $true
288- $StateUpdates [$ContentType ].LastContentCreatedUtc = $LatestContentCreated.ToString (' yyyy-MM-ddTHH:mm:ss.fffZ ' )
288+ $StateUpdates [$ContentType ].LastContentCreatedUtc = $LatestContentCreated.ToString (' yyyy-MM-ddTHH:mm:ss' )
289289 $StateUpdates [$ContentType ].LastContentId = $LatestContentId
290- $StateUpdates [$ContentType ].LastProcessedUtc = $Now.ToUniversalTime ().ToString(' yyyy-MM-ddTHH:mm:ss.fffZ ' )
290+ $StateUpdates [$ContentType ].LastProcessedUtc = $Now.ToUniversalTime ().ToString(' yyyy-MM-ddTHH:mm:ss' )
291291
292- Write-LogMessage - API ' AuditLogIngestion' - tenant $TenantFilter - message " Updated watermark for $ContentType to $ ( $LatestContentCreated.ToString (' yyyy-MM-ddTHH:mm:ss.fffZ ' )) " - sev Debug
292+ Write-LogMessage - API ' AuditLogIngestion' - tenant $TenantFilter - message " Updated watermark for $ContentType to $ ( $LatestContentCreated.ToString (' yyyy-MM-ddTHH:mm:ss' )) " - sev Debug
293293 }
294294
295295 } catch {
296296 Write-LogMessage - API ' AuditLogIngestion' - tenant $TenantFilter - message " Error processing content type $ContentType : $ ( $_.Exception.Message ) " - sev Error - LogData (Get-CippException - Exception $_ )
297297 continue
298298 }
299299 }
300-
300+
301301 $Timings [' ContentList' ] = $SwContentList
302302 $Timings [' ContentFilter' ] = $SwContentFilter
303303 $Timings [' BlobDownload' ] = $SwBlobDownload
@@ -313,7 +313,7 @@ function Push-AuditLogIngestion {
313313
314314 $TotalStopwatch.Stop ()
315315 $TotalMs = $TotalStopwatch.Elapsed.TotalMilliseconds
316-
316+
317317 $TimingReport = " AUDITLOG: Total: $ ( [math ]::Round($TotalMs , 2 )) ms"
318318 foreach ($Key in ($Timings.Keys | Sort-Object )) {
319319 $Ms = [math ]::Round($Timings [$Key ], 2 )
0 commit comments