Last active
December 21, 2015 03:39
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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