Microsoft Internet Security and Acceleration Server 2004 SDK

Creating the Root ISA Server Object

You can access almost all ISA Server administration COM objects through a single root object. You must first create this root object and then use its properties to access subordinate objects in the object model. All server arrays and other configuration settings are accessed through the root object.

To create this root object in a scripting language such as Microsoft Visual Basic Scripting Edition (VBScript) or Microsoft JScript®, use the CreateObject function. Use the class name "FPC.Root", as in these examples:

When creating the root object in Visual Basic, use the following:

Dim root As New FPCLib.FPC

CreateObject is also available to Visual Basic programmers and so, alternatively, the following can be used:

Dim root As FPCLib.FPC
Set root = CreateObject("FPC.Root")

Creation of the root object is the first step in all ISA Server scripts. If you are using Visual Basic, you must have the Microsoft Internet Security and Acceleration Server 2004 Administration Library selected as a project reference to create this object. For more information on creating a project reference in Visual Basic, see Getting Started with Administration COM Objects.

When using the administration COM objects in C++, you can use the following code to create the root object and a smart pointer to the IFPC interface:

HRESULT hr;

// Initialize the COM library.
hr = CoInitialize(NULL); 

// Create the ISA Server root object.
FPCLib::IFPCPtr sipRoot;

hr = sipRoot.CreateInstance("FPC.Root");

If you are using C++, you must first import the Msfpccom.dll file so that the ISA Server administration COM objects can be used. For more information on importing the Msfpccom.dll file, see Getting Started with Administration COM Objects.

Although almost all ISA Server administration COM objects can be accessed through a single root object, the FPCFilterExpressions collection is not part of the object hierarchy based on the FPC root object and must be created separately. The following VBScript example creates an instance of the FPCFilterExpressions collection:

Set filter = CreateObject("FPC.FPCFilterExpressions")

When creating the filter expressions collection in Visual Basic, use the following:

Dim root As New FPCLib.FPCFilterExpressions

or

Dim root As FPCLib.FPCFilterExpressions
Set root = CreateObject("FPC.FPCFilterExpressions")

When creating the filter expressions collection in C++, you can use the following code to create the collection and a smart pointer to the IFPCFilterExpressions interface:

HRESULT hr;
FPCLib::IFPCFilterExpressionsPtr sipFilterExpressionsCol;

hr = sipFilterExpressionsCol.CreateInstance("FPC.FPCFilterExpressions");

Creating the Root Object for Remote Administration

A script that will be run from a remote administration computer must use the FPCDS object, as follows:

When creating the root object in Visual Basic, use the following:

Dim root As New FPCLib.FPCDS

OR

Dim objFPC As New FPCLib.FPC
Set root = CreateObject("FPCDS.Root")

For more information on the FPCDS object, see FPC.