Forum Discussion
Ask_Itee
Sep 19, 2024Copper Contributor
PS + Start-WBBackup + Exchange 2019
I have a PS script that uses Windows Server backup to backup a Server 2019 running Exchange 2019. I am finding that even though I am executing a full system HW independant backup, the exchange transaction logs are not being flushed after the backup executes. If I run a backup manually, (mmc with Local backup snapin) the logs do get flushed. Are there additional items I need to add to the policy.
# 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)"
}
}
No RepliesBe the first to reply