Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scottglew/6244199 to your computer and use it in GitHub Desktop.
Save scottglew/6244199 to your computer and use it in GitHub Desktop.
This script exports the Forefront TMG Enterprise and Array configuration as a backup
' TMG Enterprise and Array Configuration Backup Script
'
' Purpose: The Script exports the Enterprise and Array configuration as a backup
' Changes Required: Specify a custom password, comment and backup location. Save the script as AutoExportEnterprise.vbs.
' Usage: Execute the scrip on the EMS server with the following command
' cscript AutoExportEnterprise.vbs
'
' ********** Supplied by @FastVue / @WebSpy / @FixMyITSystem / @JasonJonesUK / @RichardHicks **********
'
' ----------------------------------------------------------------------------------------
'
'Export strings
password = "mypassword"
comment = """Scripted Backup"""
'Backup location can be local or network location
BackupLocation = "\\networkname\share"
'--------------- No changes required beyond this line ------------------------------------
Dim root
Dim isaEnterprise
Dim Array
localdate = FormatDateTime(date(), 1) 'Displays according to the system long date format
Datestring = " " & localdate
Set root = CreateObject("FPC.Root")
Set isaEnterprise = root.Enterprise
'Backing Up Enterprise Config
Wscript.echo "Saving Configurations to " & BackupLocation & "...."
wscript.echo "Exporting - Entertprise Configuration"
isaEnterprise.ExportToFile BackupLocation & "Enterprise Config" & Datestring & ".xml", 15, password, comment
'Backing Up arrays
For Each Array in Root.Arrays
wscript.echo "Exporting - " & Array
Array.ExportToFile BackupLocation & Array & Datestring &".xml", 15, password, comment
Next
Wscript.echo "Exporting Completed"
WScript.Quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment