Skip to content

Start-WBBackup + Exchange 2019 not clearing logs #24351

@askitee

Description

@askitee

Prerequisites

Steps to reproduce

ENV

  • Exchange Server 2019
  • running on Server 2019,
  • Circular logging not enabled
  • PS 7.4.3 (whichever version is currently issued via Windows Update)

Command
Start-WBBackup

Issue
When I back up servers running Exchange 2019, the logs are not being flushed when a successful backup is completed. If I run Windows Ses]rver backup in the same setup, it flushes the log files.

Function

# PURPOSE: Start-AssembleAndExecuteBackup - Assembles the required commands and values and executes the backup
function Start-AssembleAndExecuteBackup {
    try {
        $Policy = New-WBPolicy
        $BackupLocation = New-WBBackupTarget -NetworkPath "$NetworkFQTarget"
        
        Add-SeperatorLineToLog
        Add-UpdateLogWithSingleLine "L" "CREATED OBJECTS" ""
        Add-UpdateLogWithSingleLine "R" "Objects" "Policy, VolumeList, and Backup Target Location"
        
        Add-WBSystemState $Policy
        Add-WBBareMetalRecovery $Policy
        Add-WBBackupTarget -Policy $Policy -Target $BackupLocation
        Set-WBVssBackupOptions -Policy $Policy -VssCopyBackup
        
        Add-SeperatorLineToLog
        Add-UpdateLogWithSingleLine "L" "STARTING BACKUP" ""
        
        if ($str_Testing -eq "ON") {
            Add-UpdateLogWithSingleLine "R" "Backup Testing Mode" "ON (No backup performed)"
        } else {
            Add-UpdateLogWithSingleLine "R" "Email" "Email Notification Sent"
            Start-WBBackup -Policy $Policy -Verbose
        }
    } catch {
        Write-Error "An error occurred: $_"
        Add-UpdateLogWithSingleLine "E" "Backup Error" "$($_.Exception.Message)"
    }
}

Expected behavior

The log files should be cleared once a successful backup completes

Actual behavior

Logs remain unflushed, no errors a reported by PS or Event Log

Error details

[22:23:33] COMPLETION STATUS                  : 
[22:23:33]                              Email : Email Notification Sent
[22:23:33]                           Job Type : Backup
[22:23:33]                         Start Time : 26/09/2024 9:01 PM
[22:23:33]                           End Time : 26/09/2024 10:23 PM
[22:23:33]                          Job Items : Microsoft.Windows.ServerBackup.Commands.WBItem[]
[22:23:33]                          Job State : Completed
[22:23:33]                  Current Operation : 
[22:23:33]                            HResult : 0
[22:23:33]                    Detailed Result : 0
[22:23:33]                        Error Descr : 
[22:23:33]                                    : 
[22:23:33]                         Version ID : 09/26/2024-11:01
[22:23:33]                     SuccessLogPath : C:\Windows\Logs\WindowsServerBackup\Backup-26-09-2024_11-01-48.log
[22:23:33]                     FailureLogPath : C:\Windows\Logs\WindowsServerBackup\Backup_Error-26-09-2024_11-01-48.log
[22:23:33]                   Data Transferred : C:\Windows\Logs\WindowsServerBackup\Backup_Error-26-09-2024_11-01-48.log
------------------------------------------------------------------

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.3
PSEdition                      Core
GitCommitId                    7.4.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

Nil to provide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-ExternalThe issue is caused by external component(s).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions