Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottglew/6241609 to your computer and use it in GitHub Desktop.
Save scottglew/6241609 to your computer and use it in GitHub Desktop.
This script exports your Forefront TMG Array configuration as a backup.
' TMG Array Configuration Backup Script
'
' Purpose: The Script exports the Array configuration as a backup
' Changes Required: Specify a custom password, comment and backup location. Save as AutoExportArray.vbs.
' Usage: Execute the scrip on the TMG server with the following command
' cscript AutoExportArray.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 Array
localdate = FormatDateTime(date(), 1) 'Displays according to the system long date format
Datestring = " " & localdate
Set root = CreateObject("FPC.Root")
Set Array = root.GetContainingArray()
'Backing Up Array Config
Wscript.echo "Saving Configuration to " & BackupLocation & "...."
wscript.echo "Exporting - " & Array
Array.ExportToFile BackupLocation & Array & Datestring &".xml", 15, password, comment
Wscript.echo "Exporting Completed"
WScript.Quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment