Skip to content

Commit

Permalink
Merge branch 'main' into RossTestBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
iserrano76 authored Oct 7, 2024
2 parents 08c77c0 + 5d2c558 commit 90826f5
Show file tree
Hide file tree
Showing 36 changed files with 472 additions and 100 deletions.
45 changes: 37 additions & 8 deletions Calendar/CalLogHelpers/CalLogCSVFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ function BuildCSV {

Write-Host "Starting to Process Calendar Logs..."
$GCDOResults = @()
$IsFromSharedCalendar = @()
$LogType = @()
$script:MailboxList = @{}
Write-Host "Creating Map of Mailboxes to CNs..."
Expand All @@ -157,8 +156,6 @@ function BuildCSV {
}
}

$IsFromSharedCalendar = ($null -ne $CalLog.externalSharingMasterId -and $CalLog.externalSharingMasterId -ne "NotFound")

# Record one row
$GCDOResults += [PSCustomObject]@{
'LogRow' = $Index
Expand All @@ -169,7 +166,7 @@ function BuildCSV {
'LogClientInfoString' = $CalLog.LogClientInfoString
'TriggerAction' = $CalLog.CalendarLogTriggerAction
'ItemClass' = $ItemType
'Seq:Exp:ItemVersion' = $CalLog.AppointmentSequenceNumber.ToString() + ":" + $CalLog.AppointmentLastSequenceNumber.ToString() + ":" + $CalLog.ItemVersion.ToString()
'Seq:Exp:ItemVersion' = CompressVersionInfo($CalLog)
'Organizer' = $CalLog.From.FriendlyDisplayName
'From' = GetBestFromAddress($CalLog.From)
'FreeBusy' = $CalLog.FreeBusyStatus.ToString()
Expand All @@ -178,8 +175,6 @@ function BuildCSV {
'LogFolder' = $CalLog.ParentDisplayName
'OriginalLogFolder' = $CalLog.OriginalParentDisplayName
'SharedFolderName' = MapSharedFolder($CalLog.ExternalSharingMasterId)
'IsFromSharedCalendar' = $IsFromSharedCalendar
'ExternalSharingMasterId' = $CalLog.ExternalSharingMasterId
'ReceivedBy' = $CalLog.ReceivedBy.SmtpEmailAddress
'ReceivedRepresenting' = $CalLog.ReceivedRepresenting.SmtpEmailAddress
'MeetingRequestType' = $CalLog.MeetingRequestType.ToString()
Expand All @@ -193,7 +188,7 @@ function BuildCSV {
'RecurrencePattern' = $CalLog.RecurrencePattern
'AppointmentAuxiliaryFlags' = $CalLog.AppointmentAuxiliaryFlags.ToString()
'DisplayAttendeesAll' = $CalLog.DisplayAttendeesAll
'AttendeeCount' = ($CalLog.DisplayAttendeesAll -split ';').Count
'AttendeeCount' = GetAttendeeCount($CalLog.DisplayAttendeesAll)
'AppointmentState' = $CalLog.AppointmentState.ToString()
'ResponseType' = $CalLog.ResponseType.ToString()
'ClientIntent' = $CalLog.ClientIntent.ToString()
Expand All @@ -205,7 +200,6 @@ function BuildCSV {
'SendMeetingMessagesDiagnostics' = $CalLog.SendMeetingMessagesDiagnostics
'AttendeeCollection' = MultiLineFormat($CalLog.AttendeeCollection)
'CalendarLogRequestId' = $CalLog.CalendarLogRequestId.ToString() # Move to front.../ Format in groups???
'CleanGlobalObjectId' = $CalLog.CleanGlobalObjectId
}
}
$script:EnhancedCalLogs = $GCDOResults
Expand All @@ -225,3 +219,38 @@ function ConvertDateTime {
}
return [DateTime]$DateTime
}

function GetAttendeeCount {
param(
[string] $AttendeeCollection
)
if ($From.SmtpAddress -ne "NotFound") {
return ($AttendeeCollection -split ';').Count
} else {
return "-"
}
}

function CompressVersionInfo {
param(
$CalLog
)
[string] $CompressedString = ""
if ($CalLog.AppointmentSequenceNumber -eq "NotFound" -or [string]::IsNullOrEmpty($CalLog.AppointmentSequenceNumber)) {
$CompressedString = "-:"
} else {
$CompressedString = $CalLog.AppointmentSequenceNumber.ToString() + ":"
}
if ($CalLog.AppointmentLastSequenceNumber -eq "NotFound" -or [string]::IsNullOrEmpty($CalLog.AppointmentLastSequenceNumber)) {
$CompressedString += "-:"
} else {
$CompressedString += $CalLog.AppointmentLastSequenceNumber.ToString() + ":"
}
if ($CalLog.ItemVersion -eq "NotFound" -or [string]::IsNullOrEmpty($CalLog.ItemVersion)) {
$CompressedString += "-"
} else {
$CompressedString += $CalLog.ItemVersion.ToString()
}

return $CompressedString
}
3 changes: 2 additions & 1 deletion Calendar/CalLogHelpers/CalLogInfoFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function SetLogType {
$ShortClientName -eq "CalendarReplication" -or
$CalendarItemTypes.($CalLog.ItemClass) -eq "SharingCFM" -or
$CalendarItemTypes.($CalLog.ItemClass) -eq "SharingDelete") {
return "Sharing"
return "Sync"
} elseif ($ShortClientName -eq "Other EBA" -or
$ShortClientName -eq "Other TBA" -or
$ShortClientName -eq "LocationProcessor" -or
Expand All @@ -129,6 +129,7 @@ function SetLogType {
return "Exception"
} elseif (($CalendarItemTypes.($CalLog.ItemClass) -like "*Resp*" -and $CalLog.CalendarLogTriggerAction -ne "Create" ) -or
$CalendarItemTypes.($CalLog.ItemClass) -eq "AttendeeList" -or
($CalendarItemTypes.($CalLog.ItemClass) -eq "Forward.Notification" -and ($CalLog.CalendarLogTriggerAction -eq "SoftDelete") -or $CalLog.CalendarLogTriggerAction -like "*move*") -or
($CalLog.ItemClass -eq "IPM.Schedule.Meeting.Request" -and $CalLog.CalendarLogTriggerAction -like "*move*" ) ) {
return "Cleanup"
} else {
Expand Down
8 changes: 4 additions & 4 deletions Calendar/CalLogHelpers/CreateTimelineRow.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ function CreateTimelineRow {
} else {
switch ($CalLog.Client) {
ResourceBookingAssistant {
[array] $Output = "ResourceBookingAssistant $($Action) a $($MeetingRespType) Meeting Response message."
[array] $Output = "ResourceBookingAssistant $($Action) a $($MeetingRespType) Meeting Response message$($Extra)."
}
Transport {
[array] $Output = "[$($CalLog.From)] $($Action) $($MeetingRespType) Meeting Response message."
[array] $Output = "[$($CalLog.From)] $($Action) $($MeetingRespType) Meeting Response message$($Extra)."
}
default {
[array] $Output = "[$($CalLog.ResponsibleUser)] $($Action) [$($CalLog.Organizer)]'s $($MeetingRespType) Meeting Response with $($CalLog.Client)."
[array] $Output = "[$($CalLog.ResponsibleUser)] $($Action) [$($CalLog.Organizer)]'s $($MeetingRespType) Meeting Response with $($CalLog.Client)$($Extra)."
}
}
}
Expand All @@ -114,7 +114,7 @@ function CreateTimelineRow {
}
Exception {
if ($CalLog.ResponsibleUser -ne "Calendar Assistant") {
[array] $Output = "[$($CalLog.ResponsibleUser)] $($CalLog.TriggerAction)d Exception to the meeting series with $($CalLog.Client)."
[array] $Output = "[$($CalLog.ResponsibleUser)] $($CalLog.TriggerAction)d Exception starting $($CalLog.StartTime) to the meeting series with $($CalLog.Client)."
}
}
Ipm.Appointment {
Expand Down
4 changes: 3 additions & 1 deletion Calendar/CalLogHelpers/ExcelModuleInstaller.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ function CheckExcelModuleInstalled {
# Install ImportExcel module
Install-Module -Name ImportExcel -Force -AllowClobber

Write-Host "Done. ImportExcel module is now installed."
Write-Host -ForegroundColor Green "Done. ImportExcel module is now installed."
Write-Host -ForegroundColor Yellow "Please rerun the Script to get your Calendar Logs."
exit
}
}
}
Expand Down
Loading

0 comments on commit 90826f5

Please sign in to comment.