Skip to content

Commit

Permalink
Merge pull request #1948 from Shanefe/CalLog_TrackingOption
Browse files Browse the repository at this point in the history
Cal log tracking option
  • Loading branch information
dpaulson45 authored Jan 19, 2024
2 parents f46b59d + e2c29ea commit 665a8e1
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions Calendar/Get-CalendarDiagnosticObjectsSummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# .PARAMETER MeetingID
# The MeetingID of the meeting to query.
#
# .PARAMETER TrackingLogs
# Include specific tracking logs in the output.
#
# .EXAMPLE
# Get-CalendarDiagnosticObjectsSummary.ps1 -Identity [email protected] -MeetingID 040000008200E00074C5B7101A82E008000000008063B5677577D9010000000000000000100000002FCDF04279AF6940A5BFB94F9B9F73CD
#
Expand All @@ -27,11 +30,12 @@ param (
[Parameter(Mandatory, Position = 0)]
[string[]]$Identity,

[Parameter(Mandatory, ParameterSetName = 'Subject', Position = 1)]
[string]$Subject,

[Parameter(Mandatory, ParameterSetName = 'MeetingID', Position = 1)]
[string]$MeetingID
[string]$MeetingID,
[switch]$TrackingLogs,

[Parameter(Mandatory, ParameterSetName = 'Subject', Position = 1)]
[string]$Subject
)

# ===================================================================================================
Expand All @@ -54,7 +58,7 @@ Write-Verbose "Script Versions: $BuildVersion"
# Constants to support the script
# ===================================================================================================

$CustomPropertyNameList =
$script:CustomPropertyNameList =
"AppointmentCounterProposal",
"AppointmentLastSequenceNumber",
"AppointmentRecurring",
Expand Down Expand Up @@ -151,13 +155,21 @@ function GetCalendarDiagnosticObjects {

$params = @{
Identity = $Identity
CustomPropertyName = $CustomPropertyNameList
CustomPropertyName = $script:CustomPropertyNameList
WarningAction = "Ignore"
MaxResults = $LogLimit
ResultSize = $LogLimit
ShouldBindToItem = $true
}

if ($TrackingLogs.IsPresent) {
Write-Host -ForegroundColor Yellow "Including Tracking Logs in the output."
$script:CustomPropertyNameList += "AttendeeListDetails", "AttendeeCollection"
$params.Add("ShouldFetchAttendeeCollection", $true)
$params.Remove("CustomPropertyName")
$params.Add("CustomPropertyName", $script:CustomPropertyNameList)
}

if ($Identity -and $MeetingID) {
Write-Verbose "Getting CalLogs for [$Identity] with MeetingID [$MeetingID]."
$CalLogs = Get-CalendarDiagnosticObjects @params -MeetingID $MeetingID
Expand Down Expand Up @@ -801,6 +813,8 @@ function BuildCSV {
'IsOrganizer' = $GetIsOrganizer
'IsOrganizerProperty' = $CalLog.IsOrganizerProperty
'EventEmailReminderTimer' = $CalLog.EventEmailReminderTimer
'AttendeeListDetails' = MultiLineFormat($CalLog.AttendeeListDetails)
'AttendeeCollection' = MultiLineFormat($CalLog.AttendeeCollection)
'CleanGlobalObjectId' = $CalLog.CleanGlobalObjectId
}
}
Expand All @@ -827,6 +841,14 @@ function BuildCSV {
}
}

function MultiLineFormat {
param(
$PassedString
)
$PassedString = $PassedString -replace "},", "},`n"
return $PassedString
}

# ===================================================================================================
# Write Out one line of the Meeting Summary (Time + Meeting Changes)
# ===================================================================================================
Expand Down

0 comments on commit 665a8e1

Please sign in to comment.