Template - createRegistryKeyTemplate

Template - createRegistryKeyTemplate

Description :

This command creates a template with one registry key.

Registry keys paths are separated with a backslash ('/'). Since backslashes are often used as an escape character on many shells, escape characters should usually be escaped. ('/').

Example key path: "HKEY_LOCAL_MACHINE/SOFTWARE/NetBeans/3.5.1" This command returns a handle to the newly created template. The handle can be used for other commands that need a reference to the new template.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

templateName

String

Template name.

groupId

Integer

Handle to the group that should contain the template.

bExplicit

Boolean

True to create an explicit template, false to create an implicit template. (An implicit template is one that does not appear in the GUI.)

assetPath

String

NSH-style path to the asset.

bRecurse

Boolean

True to recurse into sub keys, false otherwise.

bIncludeRegistryAcls

Boolean

True to collect registry ACLs, false otherwise

Example

The following example shows how to create a new template containing a single registry key asset. Other commands for creating templates for single assets are similar.

Script

# Name of the new template. 

TEMPLATE_NAME="template1" 

# Group in which template is to be stored. 

TEMPLATE_GROUP="/parent/group1" 

TEMPLATE_GROUP_ID=`blcli TemplateGroup groupNameToId $TEMPLATE_GROUP` 

# Template type. Set to false if     you want to create an implicit template. (An implicit template is one that does not appear in the GUI.) 

bExplicit="true" 

# Asset path. The path to the key you want to add. An easy way to find the format of the path is to add the key (or similar asset) to a template through the GUI and then copy it to here. 

ASSET_PATH="HKEY_LOCAL_MACHINE/SOFTWARE/parent/key" 

# Options Section # 

# Use these to set the various options available through the GUI.     Setting a value to true is the same as checking it in the GUI. 

# All options must be set to true or false for the command to succeed. 

# The text in each comment below is the label from the GUI. See the documentation for the GUI for further details on each option. 

# Snapshot/Audit - Recurse subfolders 

OPTIONS="false" 

# Snapshot - Collect Registry ACL 

OPTIONS="${OPTIONS} false" 

TEMPLATE_DBKEY=`blcli Template createRegistryKeyTemplate $TEMPLATE_NAME $TEMPLATE_GROUP_ID $bExplicit $ASSET_PATH $OPTIONS ` 

# Use the returned DBKey to add more items to the template. 



Was this page helpful? Yes No Submitting... Thank you

Comments