Backup Exchange Mailboxes with Langmeier Backup

A Langmeier Backup script can instruct a Microsoft Exchange server to export individual mailboxes to external PST files. These PST files can then be backed up by Langmeier Backup. Mailboxes backed up in this way can be restored individually.

How to set up the script for Exchange servers

In the main window of the Backup Software Langmeier Backup, click "Tools" and then "Edit Scripts". The script editor will open. Below the script editor, click on the "New" button to create a new script.

Backing up mailboxes, calendars and contacts from an Exchange server is also possible with Langmeier Backup. Here you can find out how to proceed.

Paste the following script into the script editor:

   Dim oFileSystemObject, oFile
   set fso = CreateObject("Scripting.FileSystemObject")

     sDest = Destination & ""

     'The script needs the path to be a UNC path in the form "\\localhost\c$\bck\"
    '->However, the user often enters e. g.For example, C:\bck\.
     '->Convert!
     if mid(sDest, 2, 1) = ":" then
     'An LW letter is specified with in the destination path, example C:\xyxy
     '->Replace with $
    sDest = left(sDest, 1) & "$" & mid(sDest, 3)
     ' ...and put a localhost up front:
     sDest = "\\localhost\" & sDest & "\"
     end if

    BuildFullPath sDest

    ' Now the Temporary Folder is determined:
     set sTempFolder = fso.GetSpecialFolder(2) '2 = TemporaryFolder

     'This is where the Powershell script is written:
     set oFileSystemObject = CreateObject("Scripting.FileSystemObject")
     set oFile = oFileSystemObject.CreateTextFile(sTempFolder & "\Export.ps1")
     oFile.WriteLine "Add-PSSnapin         ""Microsoft.Exchange.Management.PowerShell.E2010"""

     oFile.WriteLine "Get-MailboxExportRequest | Remove-MailboxExportRequest -confirm:$false"

     oFile.WriteLine "(Get-Mailbox) | foreach {New-MailboxExportRequest -Mailbox $_.alias -FilePath """ & sDest & "$_.pst""}"

     oFile.Close

     'Now writing the batch file:
    set oFile = oFileSystemObject.CreateTextFile(sTempFolder & "\Export.bat")
     oFile.WriteLine "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe   -command " & sTempFolder & "\Export.ps1 >" & sDest & "\log.txt"

     oFile.Close

     'Note the path to Langmeier Backup here:
    Shell "C:\Program Files (x86)\Langmeier Software\Langmeier Backup\tools\Shell64.exe" & sTempFolder & "\Export.bat"

     Sub BuildFullPath(ByVal FullPath)
     If Not fso.FolderExists(FullPath) Then
     BuildFullPath fso.GetParentFolderName(FullPath)
     fso.CreateFolder FullPath
     End If
     End Sub

Now save this script by clicking "Save As...". This button is located below the script editor. Enter the desired file name, for example "Exchange Database".

Backing up mailboxes, calendars and contacts from an Exchange server is also possible with Langmeier Backup. Here you can find out how to proceed.

Click on the "Backup" tab at the top of the Langmeier Backup main window. Add the newly created script by clicking on the text at "Add" and then "Script...".

Backing up mailboxes, calendars and contacts from an Exchange server is also possible with Langmeier Backup. Here you can find out how to proceed.

Select the desired script here, in this case our created script named"Exchange Database".

Backing up mailboxes, calendars and contacts of an Exchange server is also possible with Langmeier Backup. Here's how to proceed.

Now we've added the script to the job, but we haven't specified a destination yet.

Backing up mailboxes, calendars and contacts from an Exchange server is also possible with Langmeier Backup. Here you can find out how to proceed.

To specify the destination of the data backup, double-click the job line and enter the desired destination path for the destination:

Backing up mailboxes, calendars and contacts of an Exchange server is also possible with Langmeier Backup. Here's how to proceed.

Now all you have to do is start the backup, and the Exchange backup will appear in the form of „.pst“ files that can be imported into Outlook at the specified destination path.

System Requirements: This script works with Microsoft Exchange Server 2003 (64-bit), Exchange Server 2007 (64-bit), Exchange Server 2010, and Exchange Server 2013, and requires at least Langmeier Backup 9 Business (or higher) to run.

Save data automatically

Protect all your files.

Secure 30% discount now!   Buy Now   Try it for free
0
days
8
hours
48
minutes
8
seconds

Langmeier Backup for Windows

About the Author , partner support
Sebastian Müller Sebastian Müller is partner and top customer support at Langmeier Software, making him the best person to talk to about Langmeier backup backup solutions.

Phone: +41 44 861 15 70
Email: sebastian@langmeier-software.com
 

Further lookup: Langmeier Backup, Backup, Data backup, VB-Script

Articles relevant to the topic
Langmeier Backup Version 10 is here
FAT32 or NTFS? Which format is better for backup?
Expert Tips: What is backup? Good Data Backup


Post a comment here...

This article covers:
Langmeier Backup Exchange
Backup Exchange Mailboxes
Backup individual mailboxes
Backup Exchange
Interesting:
What is a backup
Langmeier Software
Image Backup
Backup Software