Langmeier Backup FAQ

Backing up 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.

To set up the script for Exchange servers

In the main window of the Langmeier Backup software, click on "Tools" and then on "Edit scripts". The script editor opens. Click on the "New" button below the script editor to create a new script.

Die Datensicherung von Postfächern, Kalendern und Kontakten eines Exchange-Servers ist auch mit Langmeier Backup möglich. Hier erfahren Sie, wie Sie vorgehen müssen.

Insert the following script into the script editor:

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

sDest = Destination & ""

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

BuildFullPath sDest

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

'The Powershell script is written here:
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 the batch file is written:
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 on "Save as...". This button is located below the script editor. Enter the desired file name, for example "Exchange database".

Die Datensicherung von Postfächern, Kalendern und Kontakten eines Exchange-Servers ist auch mit Langmeier Backup möglich. Hier erfahren Sie, wie Sie vorgehen müssen.

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

Die Datensicherung von Postfächern, Kalendern und Kontakten eines Exchange-Servers ist auch mit Langmeier Backup möglich. Hier erfahren Sie, wie Sie vorgehen müssen.

Select the desired script here, in this case our created script with the name "Exchange database".

Die Datensicherung von Postfächern, Kalendern und Kontakten eines Exchange-Servers ist auch mit Langmeier Backup möglich. Hier erfahren Sie, wie Sie vorgehen müssen.

We have now added the script to the task, but we have not yet specified a destination.

Die Datensicherung von Postfächern, Kalendern und Kontakten eines Exchange-Servers ist auch mit Langmeier Backup möglich. Hier erfahren Sie, wie Sie vorgehen müssen.

To specify the destination of the data backup, double-click the task line and enter the desired destination path in the destination field:

Die Datensicherung von Postfächern, Kalendern und Kontakten eines Exchange-Servers ist auch mit Langmeier Backup möglich. Hier erfahren Sie, wie Sie vorgehen müssen.

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. To run the script, at least Langmeier Backup 9 Business (or higher) is required.

Langmeier Backup

Backup for Windows

  Buy now   Try it for free

Backup Software For Windows

about the author Sebastian Müller
Partner support


Sebastian Müller is a partner and top customer advisor at Langmeier Software and therefore the best contact person for Langmeier backup solutions.

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

Look it up further: Langmeier Backup, Backup, Data backup, VB-Script

Related articles
Which type of backup is the best choice for my data?
This is how important data backup is in real life
The advantages and disadvantages of the different Windows file systems


Post a comment here...

This article covers the topics:
Langmeier Backup Exchange
Backup Exchange mailboxes
Backup mailboxes
Backup individual mailboxes