We run ISA 2004 on a Windows 2003 server, and I was looking for a way to automatically export the ISA server’s configuration on a nightly basis. I found several examples of this type of script, but most were either too basic or too complex for my needs.
Please note this script exports the ISA server’s settings, which is different that performing a backup within the ISA Server Management MMC. See KB 838375 for details regarding the differences between ISA backups and exports. In a nutshell, this KB says use exports for server cloning and provisioning, and use backups for server disaster recovery.
My script is a combination of this complex script and this more basic script. I liked how the first script saved the .xml file with the date as part of the name, but I only needed the functionality of the second script.
Here’s my script, save on the ISA server as exportisa.vbs:
Option Explicit
‘Declare some variables
Dim fName, IsaRoot, IsaServer
‘Get a reference to ISA server objects
Set IsaRoot = CreateObject(“FPC.Root”)
Set IsaServer = ISARoot.GetContainingArray
‘Filename to export the configuration
fName = “d:\ExportedISAconfigs\”& replace(Date,”/”,”_”)+”_Exported_ISA_configuration.XML”
‘Export the configuration
IsaServer.ExportToFile fName, 0
To execute the script, from a command prompt run:
cscript.exe exportisa.vbs
This will save the exported file, to the d:\ExportedISAconfigs folder. This folder must exist prior to running the script or it will error out. The name of my exported file was:
9_25_2007_Exported_ISA_configuration.XML
Lastly, I created a scheduled task that executed this .vbs script nightly. I then copy the .xml file to the NAS, and I know I could import previous configurations whenever the need may arise.