Skip to content

Commit

Permalink
Merge pull request #2202 from Shanefe/Oct_Update
Browse files Browse the repository at this point in the history
Fix Script Version Bug
  • Loading branch information
dpaulson45 authored Oct 21, 2024
2 parents 7edbdb8 + 6ab452c commit 2262289
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Calendar/CalLogHelpers/ExportToExcelFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Export-CalLogExcel {
}

function LogScriptInfo {
# Only need to run once per script.
# Only need to run once per script execution.
if ($null -eq $script:CollectedCmdLine) {
$RunInfo = @()
$RunInfo += [PSCustomObject]@{
Expand All @@ -36,7 +36,7 @@ function LogScriptInfo {
}
$RunInfo += [PSCustomObject]@{
Key = "Script Version"
Value = $script:Version
Value = $script:BuildVersion
}
$RunInfo += [PSCustomObject]@{
Key = "User"
Expand All @@ -58,7 +58,7 @@ function LogScriptInfo {
$RunInfo | Export-Excel -Path $FileName -WorksheetName "Script Info" -MoveToEnd
$script:CollectedCmdLine = $true
}
# If someone runs the script the script again logs will update, but ScriptInfo done not update. Need to add new table for each run.
# If someone runs the script the script again logs will update, but ScriptInfo does not update. Need to add new table for each run.
}

function Export-TimelineExcel {
Expand Down
16 changes: 8 additions & 8 deletions Calendar/Get-CalendarDiagnosticObjectsSummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ if (Test-ScriptVersion -AutoUpdate -VersionsUrl "https://aka.ms/CL-VersionsUrl"
}

$script:command = $MyInvocation
Write-Host -ForegroundColor Blue "The script was started with the following command line:"
Write-Host -ForegroundColor Blue "Name:" $command.MyCommand.name
Write-Host -ForegroundColor Blue "Command Line:" $command.line

Write-Verbose "Script Versions: $BuildVersion"
Write-Verbose "The script was started with the following command line:"
Write-Verbose "Name: " $command.MyCommand.name
Write-Verbose "Command Line: " $command.line
Write-Verbose "Script Version: $BuildVersion"
$script:BuildVersion = $BuildVersion

# ===================================================================================================
# Support scripts
Expand Down Expand Up @@ -168,7 +168,7 @@ if (-not ([string]::IsNullOrEmpty($Subject)) ) {
$ExceptionLogs = $LogToExamine | ForEach-Object {
$logLeftCount -= 1
Write-Verbose "Getting Exception Logs for [$($_.ItemId.ObjectId)]"
Get-CalendarDiagnosticObjects -Identity $ID -ItemIds $_.ItemId.ObjectId -ShouldFetchRecurrenceExceptions $true -CustomPropertyNames $CustomPropertyNameList
Get-CalendarDiagnosticObjects -Identity $ID -ItemIds $_.ItemId.ObjectId -ShouldFetchRecurrenceExceptions $true -CustomPropertyNames $CustomPropertyNameList -ShouldBindToItem $true
if ($logLeftCount % 20 -eq 0) {
Write-Host -ForegroundColor Cyan "`t [$($logLeftCount)] logs left to examine..."
}
Expand Down Expand Up @@ -196,8 +196,8 @@ if (-not ([string]::IsNullOrEmpty($Subject)) ) {
}

Write-DashLineBoxColor "Hope this script was helpful in getting and understanding the Calendar Logs.",
"More Info on Getting the logs: https://learn.microsoft.com/en-us/exchange/troubleshoot/calendars/get-calendar-diagnostic-logs",
"and on Analyzing the logs: https://learn.microsoft.com/en-us/exchange/troubleshoot/calendars/analyze-calendar-diagnostic-logs",
"More Info on Getting the logs: https://aka.ms/GetCalLogs",
"and on Analyzing the logs: https://aka.ms/AnalyzeCalLogs",
"If you have issues or suggestion for this script, please send them to: ",
"`t [email protected]" -Color Yellow -DashChar "="

Expand Down
6 changes: 3 additions & 3 deletions Calendar/Get-RBASummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,8 @@ function RBALogSummary {

$RBALog = ((Export-MailboxDiagnosticLogs $Identity -ComponentName RBA).MailboxLog -split "`\n`\r").Trim()

Write-Host "`tFound $($RBALog.count) RBA Log entries in RBALog. Summarizing Accepts, Declines, and Tentative meetings."

if ($RBALog.count -gt 1) {
Write-Host "`tFound $($RBALog.count) RBA Log entries in RBALog. Summarizing Accepts, Declines, and Tentative meetings."
$Starts = $RBALog | Select-String -Pattern "START -"
$FirstDate = "[Unknown]"
$LastDate = "[Unknown]"
Expand Down Expand Up @@ -626,6 +625,8 @@ function RBALogSummary {
Write-Host -ForegroundColor Cyan $Filename -NoNewline
Write-Host "] in the current directory."
$RBALog | Out-File $Filename

RBAPostScript
} else {
Write-Warning "No RBA Logs found. Send a test meeting invite to the room and try again if this is a newly created room mailbox."
}
Expand Down Expand Up @@ -768,5 +769,4 @@ RBADelegateSettings
RBAPostProcessing
VerbosePostProcessing
RBALogSummary
RBAPostScript
Stop-Transcript
4 changes: 4 additions & 0 deletions docs/Calendar/Get-CalendarDiagnosticObjectsSummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ Get-CalendarDiagnosticObjectsSummary.ps1 -Identity $Users -MeetingID $MeetingID
```
Will create file like `.\123456_CalLogSummary_<MeetingID>.xlsx` in current directory.


More Documentation on collecting CalLogs and Analyzing them:
[How to Get Calendar Logs](https://aka.ms/GetCalLogs)
[How to Analyze Calendar Logs](https://aka.ms/AnalyzeCalLogs)

0 comments on commit 2262289

Please sign in to comment.