Novell ZENworks Endpoint Security Management 3.5 Manuale Utente

Pagina di 245
ZENworks® ESM 3.5
Administrator’s Manual
146
Rule Scripting Parameters
The ZENworks Endpoint Security Management (ESM) supports standard Jscript and VBScript 
coding methods readily available, with the following exceptions:
1. WScript.Echo - Not supported - (displaying return values back to a parent window are not 
support (since the parent window is unavailable)).  Use the Action.Message ESM API instead.
2. Access to Shell Objects - Use the following modified nomenclature/call:
[JScript] 
Use: 
var WshShell = new ActiveXObject("WScript.Shell");
Instead of: 
var WshShell = WScript.CreateObject ("WScript.Shell");
[VBScript] 
Use:
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
Instead of:
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
3. All scripts are executed in the "system context" unless the following comment is added to the 
top of the script:
[Jscript] 
//@ImpersonateLoggedOnUser
[VBScript] 
'@ImpersonateLoggedOnUser
Rule Scripting
A rule consists of two parts.  The first part is the Trigger Events which determine when to execute 
the rule.  The second part is the scripting code which contains the logic of the rule.  The Endpoint 
Security Client provides three namespaces and five interfaces for the script, which allows the 
script to control or access the client.
The namespaces are as follows:
1. Query.  This namespace provides methods to get the current state of  the client.  For example, 
information about the adapters, shield states and location. 
2. Action.  This namespace provides methods that get the client to do something.  For example, 
a call that puts the client into a quarantined shield state. 
3. Storage.  This namespace provides a mechanism for the script to store variables for the ses-
sion or permanently.  These could be used to tell the script if the rule had failed the last time it 
was run.  It could be used to store when this rule last ran.