Chatee ahora con Soporte
Chat con el soporte

InTrust 11.4.2 - Customization Kit

Enumerate Sites

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:

  1. Use the CreateSiteItem(2) function to create a computer object.

  2. 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.

  3. 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.

  4. 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).

Language Reference

ECMAScript

JScript

REL

PowerShell Script

ECMAScript

ECMAScript is a cross-platform scripting environment that InTrust can use for the following:

  • Scripted data sources
  • ECMAScript-based rules
  • Scripts run by real-time monitoring rules as response actions

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

JScript is the implementation of JavaScript by Microsoft, available only on Windows systems.

InTrust can use JScript for the following:

  • Scripts run by real-time monitoring rules as response actions
  • Pre-filtering and matching scripts in rules
Documentos relacionados

The document was helpful.

Seleccionar calificación

I easily found the information I needed.

Seleccionar calificación