You can customize the object enumeration logic for InTrust sites by providing custom enumeration scripts as site objects. To customize site enumeration, create a script object in the Quest InTrust Manager | Configuration | Advanced | Scripts container implementing the desired logic, and specify that script for your site.
For details about using script objects, see InTrust Script Objects.
Only ECMAScript is supported for site enumeration scripts. The script needs to implement the Enumerate(typeItemType) function. Currently, the value of typeItemType can be only 2 (computer).
The function should do the following:
Use the CreateSiteItem(2) function to create a computer object.
When the computer object has been created and returned by CreateSiteItem(), set its properties.
In a computer object, only the OriginalName property needs to be set explicitly. The remaining properties are set automatically.
Add the object to the site using the AddSiteItem(objectSiteItem) function.
This function accepts a single parameter: the site item object created on the previous step.
To report any possible script runtime errors, use the ReportError(internalCode, internalMessage, systemCode, systemMessage) function.
The resulting message is constructed consists of:
internalMessage if internalCode equals E_FAIL
internalMessage + systemMessage in all other cases
The systemCode parameter is reserved.
The message should be visible in the enumeration pane and in session logs if the site enumeration is initiated by InTrust jobs.
Additional features of site enumeration scripts:
Parameters are supported, as in real-time monitoring response action scripts. The parameter syntax is the same. For details, see the "Execute Script" Response Action section.
Traces can be output. These traces are written by the MSNNSiteProvider component. However, its traces are related not only to site enumeration scripts, so it is a good idea to identify scripted enumeration traces, for example, by using a meaningful prefix in their messages. For details about tracing, see InTrust Server Tracing.
#INCLUDE statements are supported.
The following adds the local host to the site:
function AddComputerToSite( strComputerName, SiteObjectType )
{
#TRACE TraceDebug "enter ->AddComputerToSite"
var NewSiteItem = CreateSiteItem(SiteObjectType);
NewSiteItem.OriginalName = strComputerName;
AddSiteItem(NewSiteItem);
#TRACE TraceDebug "exit ->AddComputerToSite"
}
function Enumerate( SiteItemType )
{
AddComputerToSite( "127.0.0.1", 2 );
}
In this sample, modify the Enumerate() function to do useful work (for example, cycle through computers in an Active Directory domain to find and add those with specific properties).
ECMAScript is a cross-platform scripting environment that InTrust can use for the following:
When using ECMAScript with InTrust-specific extensions, mind that it does not fully support ActiveX objects.
The ECMA-262 standard defines the ECMAScript scripting language.
JScript is the implementation of JavaScript by Microsoft, available only on Windows systems.
InTrust can use JScript for the following:
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center