From 0e173f26f2bddad0ba8b1db0a1c5808dc042469a Mon Sep 17 00:00:00 2001 From: Shane Ferrell Date: Wed, 10 Jan 2024 13:53:37 -0800 Subject: [PATCH 1/3] Save Timeline as CSV --- .../Get-CalendarDiagnosticObjectsSummary.ps1 | 40 ++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 b/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 index 4d5892d96e..fc524dc5f3 100644 --- a/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 +++ b/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 @@ -106,6 +106,7 @@ $ShortClientNameProcessor = @{ 'Lync for Mac' = "LyncMac" 'AppId=00000004-0000-0ff1-ce00-000000000000' = "SkypeMMS" 'MicrosoftNinja' = "Teams" + 'SkypeSpaces' = "Teams" 'Remove-CalendarEvents' = "RemoveCalendarEvent" 'Client=POP3/IMAP4' = "PopImap" 'Client=OWA' = "OWA" @@ -115,6 +116,7 @@ $ShortClientNameProcessor = @{ 'AppId=1e3faf23-d2d2-456a-9e3e-55db63b869b0' = "CiscoWebex" 'AppId=1c3a76cc-470a-46d7-8ba9-713cfbb2c01f' = "Time Service" 'AppId=48af08dc-f6d2-435f-b2a7-069abd99c086' = "RestConnector" + 'AppId=7b7fdad6-df9d-4cd5-a4f2-b5f749350419' = "Bookings B2 Service" 'GriffinRestClient' = "GriffinRestClient" 'MacOutlook' = "MacOutlookRest" 'Outlook-iOS-Android' = "OutlookMobile" @@ -268,6 +270,7 @@ function Convert-Data { } $FinalArray += $FinalObj } + return $FinalArray $FinalArray = @() } @@ -550,6 +553,10 @@ function CreateShortClientName { $ShortClientName = "MacOutlookRest" } elseif ($ClientInfoString -like "*Microsoft Outlook 16*") { $ShortClientName = "Outlook-ModernCalendarSharing" + } elseif ($ClientInfoString -like "*SkypeSpaces*") { + $ShortClientName = "Teams" + } elseif ($ClientInfoString -like "*AppId=7b7fdad6-df9d-4cd5-a4f2-b5f749350419*") { + $ShortClientName = "Bookings B2 Service"; } else { $ShortClientName = "[Unknown Rest Client]" } @@ -596,17 +603,20 @@ function SetIsIgnorable { $CalLog ) - if ($ShortClientName -like "EBA*" ` + if ($ShortClientName -like "TBA*SharingSyncAssistant" ` + -or $ShortClientName -eq "CalendarReplication" ` + -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" ` + -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete") { + return "Sharing" + } elseif ($CalendarItemTypes.($CalLog.ItemClass) -eq "RespAny" ` + -or $CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList") { + return "Response" + } elseif ($ShortClientName -like "EBA*" ` -or $ShortClientName -like "TBA*" ` -or $ShortClientName -eq "LocationProcessor" ` -or $ShortClientName -eq "GriffinRestClient" ` -or $ShortClientName -eq "RestConnector" ` - -or $ShortClientName -eq "CalendarReplication" ` - -or $ShortClientName -eq "TimeService" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "RespAny") { + -or $ShortClientName -eq "TimeService" ) { return "True" } else { return "False" @@ -805,7 +815,7 @@ function BuildCSV { # =================================================================================================== # Write Out one line of the Meeting Summary (Time + Meeting Changes) -# =================================================================================================== +# ===================================================================================================` function MeetingSummary { param( [array] $Time, @@ -861,7 +871,11 @@ function MeetingSummary { $MeetingChanges += $InitialToList, $InitialLocation, $InitialStartTime, $InitialEndTime, $InitialRecurring } - Convert-Data -ArrayNames "Time", "MeetingChanges" + # Convert-Data -ArrayNames "Time", "MeetingChanges" >> $Script:TimeLineFilename + $TimeLineOutput = Convert-Data -ArrayNames "Time", "MeetingChanges" + + $TimeLineOutput | Export-Csv -Path $Script:TimeLineFilename -NoTypeInformation -Encoding UTF8 -Append + $TimeLineOutput } # =================================================================================================== @@ -894,6 +908,14 @@ function BuildTimeline { param ( [string] $Identity ) + $ThisMeetingID = $script:GCDO.CleanGlobalObjectId | Select-Object -Unique + $ShortMeetingID = $ThisMeetingID.Substring($ThisMeetingID.length - 6) + if ($Identity -like "*@*") { + $ShortName = $Identity.Split('@')[0] + } + $ShortName = $ShortName.Substring(0, [System.Math]::Min(20, $ShortName.Length)) + $Script:TimeLineFilename = "$($ShortName)_TimeLine_$ShortMeetingID.csv" + Write-DashLineBoxColor " TimeLine for [$Identity]:", " Subject: $($script:GCDO[0].NormalizedSubject)", " Organizer: $($script:GCDO[0].SentRepresentingDisplayName)", From faf6d7b77149fdf7a4e7022e9b9c353bdba6c327 Mon Sep 17 00:00:00 2001 From: Shane Ferrell Date: Wed, 10 Jan 2024 14:01:32 -0800 Subject: [PATCH 2/3] Code Cleanup --- .../Get-CalendarDiagnosticObjectsSummary.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 b/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 index fc524dc5f3..d8099a16ba 100644 --- a/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 +++ b/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 @@ -556,7 +556,7 @@ function CreateShortClientName { } elseif ($ClientInfoString -like "*SkypeSpaces*") { $ShortClientName = "Teams" } elseif ($ClientInfoString -like "*AppId=7b7fdad6-df9d-4cd5-a4f2-b5f749350419*") { - $ShortClientName = "Bookings B2 Service"; + $ShortClientName = "Bookings B2 Service" } else { $ShortClientName = "[Unknown Rest Client]" } @@ -604,13 +604,13 @@ function SetIsIgnorable { ) if ($ShortClientName -like "TBA*SharingSyncAssistant" ` - -or $ShortClientName -eq "CalendarReplication" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete") { - return "Sharing" + -or $ShortClientName -eq "CalendarReplication" ` + -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" ` + -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete") { + return "Sharing" } elseif ($CalendarItemTypes.($CalLog.ItemClass) -eq "RespAny" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList") { - return "Response" + -or $CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList") { + return "Resp" } elseif ($ShortClientName -like "EBA*" ` -or $ShortClientName -like "TBA*" ` -or $ShortClientName -eq "LocationProcessor" ` @@ -815,7 +815,7 @@ function BuildCSV { # =================================================================================================== # Write Out one line of the Meeting Summary (Time + Meeting Changes) -# ===================================================================================================` +# =================================================================================================== function MeetingSummary { param( [array] $Time, @@ -873,7 +873,7 @@ function MeetingSummary { # Convert-Data -ArrayNames "Time", "MeetingChanges" >> $Script:TimeLineFilename $TimeLineOutput = Convert-Data -ArrayNames "Time", "MeetingChanges" - + $TimeLineOutput | Export-Csv -Path $Script:TimeLineFilename -NoTypeInformation -Encoding UTF8 -Append $TimeLineOutput } From bc6f3afead7e66df3aadb7e8c299b79f9c0006c9 Mon Sep 17 00:00:00 2001 From: Shane Ferrell Date: Fri, 12 Jan 2024 08:29:18 -0800 Subject: [PATCH 3/3] No BackTicks, ClientInfoStringMapping --- .../Get-CalendarDiagnosticObjectsSummary.ps1 | 53 ++++++++++++------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 b/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 index d8099a16ba..9acf9d14cf 100644 --- a/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 +++ b/Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 @@ -103,6 +103,7 @@ $script:CalendarItemTypes = @{ $ShortClientNameProcessor = @{ 'Client=Hub Transport' = "Transport" 'Client=MSExchangeRPC' = "Outlook-MAPI" + 'OneOutlook' = "OneOutlook" 'Lync for Mac' = "LyncMac" 'AppId=00000004-0000-0ff1-ce00-000000000000' = "SkypeMMS" 'MicrosoftNinja' = "Teams" @@ -547,8 +548,6 @@ function CreateShortClientName { $ShortClientName = "RestConnector" } elseif ($ClientInfoString -like "*GriffinRestClient*") { $ShortClientName = "GriffinRestClient" - } elseif ($ClientInfoString -like "*NoUserAgent*") { - $ShortClientName = "RestUnknown" } elseif ($ClientInfoString -like "*MacOutlook*") { $ShortClientName = "MacOutlookRest" } elseif ($ClientInfoString -like "*Microsoft Outlook 16*") { @@ -557,6 +556,12 @@ function CreateShortClientName { $ShortClientName = "Teams" } elseif ($ClientInfoString -like "*AppId=7b7fdad6-df9d-4cd5-a4f2-b5f749350419*") { $ShortClientName = "Bookings B2 Service" + } elseif ($ClientInfoString -like "*bcad1a65-78eb-4725-9bce-ce1a8ed30b95*" -or + $ClientInfoString -like "*43375d74-c6a5-4d4e-a0a3-de139860ea75*" -or + $ClientInfoString -like "*af9fc99a-5ae5-46e1-bbd7-fa25088e16c9*") { + $ShortClientName = "ELC-B2" + } elseif ($ClientInfoString -like "*NoUserAgent*") { + $ShortClientName = "RestUnknown" } else { $ShortClientName = "[Unknown Rest Client]" } @@ -573,7 +578,9 @@ function CreateShortClientName { } } - if ($ClientInfoString -like "*InternalCalendarSharing*" -and $ClientInfoString -like "*OWA*") { + if ($ClientInfoString -like "*InternalCalendarSharing*" -and + $ClientInfoString -like "*OWA*" -and + $ClientInfoString -notlike "*OneOutlook*") { $ShortClientName = "Owa-ModernCalendarSharing" } if ($ClientInfoString -like "*InternalCalendarSharing*" -and $ClientInfoString -like "*MacOutlook*") { @@ -585,7 +592,9 @@ function CreateShortClientName { if ($ClientInfoString -like "Client=ActiveSync*" -and $ClientInfoString -like "*Outlook*") { $ShortClientName = "Outlook-ModernCalendarSharing" } - + if ($ClientInfoString -like "*OneOutlook*") { + $ShortClientName = "OneOutlook" + } if ($ShortClientName -eq "") { $ShortClientName = "[NoShortNameFound]" } @@ -603,20 +612,22 @@ function SetIsIgnorable { $CalLog ) - if ($ShortClientName -like "TBA*SharingSyncAssistant" ` - -or $ShortClientName -eq "CalendarReplication" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete") { + if ($ShortClientName -like "TBA*SharingSyncAssistant" -or + $ShortClientName -eq "CalendarReplication" -or + $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" -or + $CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete") { return "Sharing" - } elseif ($CalendarItemTypes.($CalLog.ItemClass) -eq "RespAny" ` - -or $CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList") { + } elseif (($CalendarItemTypes.($CalLog.ItemClass) -like "*Resp*" -and + $CalLog.CalendarLogTriggerAction -ne "Create" ) -or + $CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList") { return "Resp" - } elseif ($ShortClientName -like "EBA*" ` - -or $ShortClientName -like "TBA*" ` - -or $ShortClientName -eq "LocationProcessor" ` - -or $ShortClientName -eq "GriffinRestClient" ` - -or $ShortClientName -eq "RestConnector" ` - -or $ShortClientName -eq "TimeService" ) { + } elseif ($ShortClientName -like "EBA*" -or + $ShortClientName -like "TBA*" -or + $ShortClientName -eq "LocationProcessor" -or + $ShortClientName -eq "GriffinRestClient" -or + $ShortClientName -eq "RestConnector" -or + $ShortClientName -eq "ELC-B2" -or + $ShortClientName -eq "TimeService" ) { return "True" } else { return "False" @@ -711,10 +722,13 @@ function BuildCSV { $IsIgnorable = SetIsIgnorable($CalLog) - # CleanNotFounds; + # CleanNotFounds $PropsToClean = "FreeBusyStatus", "ClientIntent", "AppointmentLastSequenceNumber", "RecurrencePattern", "AppointmentAuxiliaryFlags", "IsOrganizerProperty", "EventEmailReminderTimer", "IsSeriesCancelled", "AppointmentCounterProposal", "MeetingRequestType" foreach ($Prop in $PropsToClean) { - $CalLog.$Prop = ReplaceNotFound($CalLog.$Prop) + # Exception objects, etc. don't have these properties. + if ($null -ne $CalLog.$Prop) { + $CalLog.$Prop = ReplaceNotFound($CalLog.$Prop) + } } if ($CalLogACP -eq "NotFound") { @@ -1440,7 +1454,8 @@ function GetCalLogsWithSubject { $script:GCDO = $InitialCDOs; # use the CalLogs that we already have, since there is only one. BuildCSV -Identity $Identity BuildTimeline -Identity $Identity - }$ID + } + # Get the CalLogs for each MeetingID found. if ($GlobalObjectIds.count -gt 1) { Write-Host "Found multiple GlobalObjectIds: $($GlobalObjectIds.Count)."