-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1948 from Shanefe/CalLog_TrackingOption
Cal log tracking option
- Loading branch information
Showing
1 changed file
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
# | ||
|
@@ -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 | ||
) | ||
|
||
# =================================================================================================== | ||
|
@@ -54,7 +58,7 @@ Write-Verbose "Script Versions: $BuildVersion" | |
# Constants to support the script | ||
# =================================================================================================== | ||
|
||
$CustomPropertyNameList = | ||
$script:CustomPropertyNameList = | ||
"AppointmentCounterProposal", | ||
"AppointmentLastSequenceNumber", | ||
"AppointmentRecurring", | ||
|
@@ -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 | ||
|
@@ -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 | ||
} | ||
} | ||
|
@@ -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) | ||
# =================================================================================================== | ||
|