The basis of scripting requires some
Table 12-1 shows the basic terminology of scripting objects.
|
Name |
Description |
Example |
|---|---|---|
|
Variable |
A variable is a temporary place to hold data in a program. It is declared with the Dim statement. |
Dim objRoot |
|
Object |
Objects are reusable software
|
Set objRoot = CreateObject("FPC.Root")
|
|
Property |
A property is either a value or a characteristic that is held by an object. |
FPCComputer.Description = "Server" |
|
Method |
A method is a command that
|
objFPCComputers.Save |
|
Sub |
A sub procedure is a part of code that does not return any value. |
Sub WriteIT(value) Wscript.Echo value End Sub |
|
Function |
A function procedure is a part of code and can return a value. |
Function TrimIT(value) TrimIT = Trim(value) End Function |
When writing scripts against ISA Server you need to know what objects, properties, and methods the ISA server exposes and how to access and control them. Information on how to write scripts is included in the SDK for ISA Server 2004. We take a closer look at the ISA Server 2004 SDK as we are writing the scripts.
| Tip |
You can download the ISA Server 2004 SDK from http://go.microsoft.com/?linkid=2392254 . The SDK can be used with both Standard Edition and Enterprise Edition. |
Note that the naming convention used in all the samples is built on the object type prefix, and then the name of the COM object. This convention makes it easier to search the SDK for more information. An example of this naming convention would be objRoot , where obj is the prefix for an object and Root is the object itself. Table 12-2 illustrates other commonly used prefixes in VBScript.
|
Type |
Prefix |
Example |
|---|---|---|
|
Boolean |
bln |
blnFound |
|
Date |
dtm |
dtmStartTime |
|
Integer |
int |
intCounter |
|
Object |
obj |
objRoot |
|
String |
str |
strComputerName |
The first thing you should do is create a test lab in a virtual environment so that you can make mistakes without
| Note |
See Chapter 19, "Configuring Microsoft ISA Server with Microsoft Virtual Server 2005," for more information about how to use Microsoft Virtual Server to configure a test environment. You can also use Virtual PC to configure a test environment. See the Microsoft Virtual PC site at
http://www.microsoft.com/
|
Once you have downloaded the ISA Server 2004 SDK from http://go.microsoft.com/?linkid=2392254 , you can install it by following these steps:
On the ISA Server 2004 computer, log on as an administrator.
Run ISA2004SDK.exe, and install with the default settings.
The updated version of the ISA Server 2004 SDK will be located in C:\Program Files\Microsoft ISA 2004 SDK\HHelp\Isasdk.chm.
| Note |
You can download all of the sample scripts from this chapter at http://www.isamvp.com/apc . |
| Tip |
You can use the Microsoft Script Editor (MSE), which comes with Microsoft Office 2000 and later versions. To open the MSE, from the Tools menu of any Office application, select Macros, and then select Microsoft Script Editor. One other very useful editor that makes creating and working with scripts easy is PrimalScript, by Sapien Technology. You can download a trial version at http://www.sapien.com . If you don't have either of these tools, you can use Notepad. |
| Best Practices |
Create and test your scripts in a test environment—such as a test workstation, or a Virtual PC image—not on the ISA server itself. |