Skip to content

Instantly share code, notes, and snippets.

@JeremyTBradshaw
Created March 5, 2021 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JeremyTBradshaw/9167bae076a9937cece43bb553e59aa9 to your computer and use it in GitHub Desktop.
Save JeremyTBradshaw/9167bae076a9937cece43bb553e59aa9 to your computer and use it in GitHub Desktop.
Exchange pre-CU Backup
# Backup all *.config files.
# Backup all supported OWA customization files:
# https://docs.microsoft.com/en-us/Exchange/clients/outlook-on-the-web/customize-outlook-on-the-web?view=exchserver-2016
# https://docs.microsoft.com/en-us/Exchange/clients/outlook-on-the-web/customize-outlook-on-the-web?view=exchserver-2019
$BackupLocation = "$HOME\Desktop\Exchange_pre-CU_Backup\"
$ExInstallRoot = 'C:\Program Files\Microsoft\Exchange Server\v15\'
$OwaAuthDir = '\FrontEnd\HttpProxy\owa\auth\'
$OwaPremDir = '\ClientAccess\Owa\prem\'
$FilesToBackup = @()
$FilesToBackup += Get-ChildItem -Path $ExInstallRoot -Filter *.config -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaAuthDir)" -Filter logon.css -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaAuthDir)" -Filter errorFE.css -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaAuthDir)" -Filter favicon.ico -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaAuthDir)" -Filter Sign_in_arrow*.png -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaAuthDir)" -Filter olk_logo_white_cropped.png -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaPremDir)" -Filter languageselection.css -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaPremDir)" -Filter olk_logo_white.png -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaPremDir)" -Filter owa_text_blue.png -Recurse
$FilesToBackup += Get-ChildItem -Path "$($ExInstallRoot)\$($OwaPremDir)" -Filter office_logo_white_small.png -Recurse
$FilesToBackup | ForEach-Object {
$CopyDestination = "$($BackupLocation)\$($_.FullName -Replace ':')"
New-Item -ItemType File -Path $CopyDestination -Force
Copy-Item -Path $_.FullName -Destination $CopyDestination -Force
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment