Valid on Windows and Unix
The CcnfSetParameterStr function modifies the value of an existing common configuration parameter of type string.
This common configuration parameter function has the format:
CcnfSetParameterStr(Parametername as string, Value as string) as boolean
Parametername
Name of a Common Configuration Parameter including its absolute path (for example, "itrm/rc/protocols/encrypt/dll")
Value
String value of Parametername
The return value of the function is a boolean. If successful, the function returns TRUE. If the function is not successful, an error is reported in the log file.
The correctness of the value is not verified.
Example: CcnfSetParameterStr function
This example uses a comstore parameter that is described in the chapter Mapping Between asm.cnf and comstore.xml in the Implementation Guide.
if CcnfSetParameterStr("itrm/usd/shared/nos", "newValue") then
Print("value of itrm/usd/shared/nos was modified" )
else
Print("CcnfSetParameterStr failed")
endif
When you create custom Intellisigs, call the DMScript functions within your Intellisig script for reporting software records that are detected on the agent computer. DMScript provides built-in functions that write detected software records to an output file.
Note: DMScript is a scripting language that provides a common means of executing commands on agents. For more information about DMScript, see the Desktop Management Scripting Language guide in the CA IT Client Manager bookshelf.
The Intellisig script must call the functions in the following order:
The OpenDetectedSoftwareOutputFiles function creates an empty software detection output file for the Intellisig. A software detection output file contains all of the records detected for an Intellisig. When the Intellisig script executes at the agent computer, the OpenDetectedSoftwareOutputFiles function creates an output file to store all the software detected by the Intellisig. For example, if an Intellisig includes definitions for all Adobe products, releases, and patches, you can write all the Adobe detection records to the same output file.
Note: The Intellisig script must call the OpenDetectedSoftwareOutputFiles function regardless of whether the Intellisig detects any software or not. An Intellisig that does not create an output file generates an error during execution.
This function has the following format:
OpenDetectedSoftwareOutputFiles (IntellisigUUID as String, Version as String, Name as String)as integer
Example: OpenDetectedSoftwareOutputFiles
OpenDetectedSoftwareOutputFiles ("A7C1E14A-7C93-4E17-B4E5-45B796717F49", "V1", "OS Detection for Windows")
Input Parameters
This function has the following input parameters:
Specifies the Universal Unique Identifier (UUID) of the Intellisig. The function creates a software detection output file with the given UUID as the file name.
Specifies the version number of the Intellisig.
Specifies the name of the Intellisig. Use a name that describes the Intellisig.
Return Values
Indicates that the function completed the operation successfully.
Indicates that one or more mandatory parameters passed to the function are blank.
Indicates that the function was unable to open the file. See the log file for more information.
The CreateDetectedSoftwareProduct function adds a record to the software detection output file when the script detects a product that is related to the Intellisig on the agent computer.
This function has the following format:
CreateDetectedSoftwareProduct (ProductName as String, ProductVersion as String, OptionalProperties as String) as integer
Example: CreateDetectedSoftwareProduct
CreateDetectedSoftwareProduct(("Microsoft Windows 7 Ultimate", "6.1", "VersionNumber=6.1 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Product")
Note: This function must be called before calling the CreateDetectedSoftwareRelease function, which creates the release of the product.
Input Parameters
This function has the following input parameters:
Specifies the product name of the detected software.
Note: The product name must be unique within the Intellisig. Two products with the same name within an Intellisig are treated as the same product regardless of optional parameters. If the same product is detected using two different Intellisigs, two separate detected records are created, one for each Intellisig.
Specifies the version label of the product.
Note: The version label is used to identify the product together with its name. An empty value is allowed and is treated as a product with an empty version.
Specifies the optional properties that are associated with the detected software product. Following optional properties are available for products:
Specifies the version number of the product. Version number is a numeric value separated by dots, for example, 6.1.7600.0.
Specifies the language in which the product is installed.
Specifies whether the product uses 32-bit or 64-bit architecture. Valid values include 32 and 64.
Specifies the architecture name that the product uses. For a complete list of architectures, see Supported Architectures.
Specifies the name of the product manufacturer.
Specifies the name of the product category.
Specifies the UUID of the product manufacturer.
Specifies the UUID of the product category.
Specifies the description of the product.
Return Values
Indicates that the function completed the operation successfully.
Indicates that one or more mandatory parameters passed to the function are blank.
Indicates that the function was unable to write to the file. See the log file for more information.
The CreateDetectedSoftwareRelease function adds a record to the software detection output file when the script detects a release of a product on the agent computer.
Note: DMScript adds the record only if it finds the related product record in the MDB.
This function has the following format:
CreateDetectedSoftwareRelease (ProductName as String, ProductVersionLabel, as String, ReleaseName as String, ReleaseVersionLabel as String, OptionalProperties as String) as integer
Example: CreateDetectedSoftwareRelease
CreateDetectedSoftwareRelease ("Microsoft Windows 7 Ultimate", "6.1", "Microsoft Windows 7 Ultimate x64 64 en-us", "6.1.7600", "VersionNumber=6.1.7600 |Language=en-us |Bitness=64 |Architecture=x64 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Release")
Input Parameters
This function has the following input parameters:
Specifies the product name that the release belongs to. You must have called the CreateDetectedSoftwareProduct function for this product within the script.
Specifies the version label of the product.
Note: The version label is used to identify the product together with its name. An empty value is allowed and is treated as a product with an empty version.
Specifies the name of the discovered software release.
Note: A release can have the same name as the product. However, Intellisigs support different release names to help associate multiple releases with the same product. The release name and version label must be unique within each Intellisig chain. Two releases with the same name within an Intellisig are treated as the same release only if they share the same parent definitions, regardless of optional parameters. If the same release is detected using two different Intellisigs, two separate detected records are created, one for each Intellisig.
Specifies the version label of the release.
Note: The version label is used to identify the release together with its name. An empty value is allowed and is treated as a release with an empty version.
Specifies the optional properties associated with the discovered software release. Following optional properties are available for releases:
Specifies the version number of the release. Version number is a numeric value separated by dots, for example, 6.1.7600.0.
Specifies the language in which the release is installed.
Specifies whether the release uses 32-bit or 64-bit architecture. Valid values include 32 and 64.
Specifies the architecture name that the release uses. For a complete list of architectures, see Supported Architectures.
Specifies the name of the release manufacturer.
Specifies the name of the release category.
Specifies the UUID of the release manufacturer.
Specifies the UUID of the release category.
Specifies the description of the release.
Return Values
Indicates that the function completed the operation successfully.
Indicates that one or more mandatory parameters passed to the function are blank.
Indicates that the function was unable to write to the file. See the log file for more information.
The CreateDetectedSoftwarePatch function adds a record to the software detection output file when the script detects a patch of a particular release on the agent computer. Add this function for every patch that you have included in the Intellisig script.
This function has the following format:
CreateDetectedSoftwarePatch (ProductName as String, ProductVersionLabel, as String, ReleaseName as String, ReleaseVersionLabel as String, PatchName as String, PatchVersionLabel as String, OptionalProperties as String) as integer
Example: CreateDetectedSoftwarePatch
CreateDetectedSoftwarePatch ("Microsoft Windows 7 Ultimate", "6.1", "Microsoft Windows 7 Ultimate x64 64 en-us", "6.1.7600", "KB971033 x64 64 en-us", "Language=en-us |Bitness=64 |Architecture=x64 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Activation Checker Update")
Note: This function must be called after calling the CreateDetectedSoftwareRelease function within each script.
Input Parameters
This function has the following input parameters:
Specifies the name of the product that the patch belongs to. You must have called the CreateDetectedSoftwareProduct function for this product within the script.
Specifies the version label of the product.
Note: The version label is used to identify the product together with its name. An empty value is allowed and is treated as a product with an empty version.
Specifies the name of the release that the patch belongs to. You must have called the CreateDetectedSoftwareRelease function for this release within the script.
Specifies the version label of the release.
Note: The version label is used to identify the release together with its name. An empty value is allowed and is treated as a release with an empty version.
Specifies the name of the detected software patch.
Note: A patch cannot have the same name as the release or product to which it belongs. The patch name and version label must be unique within each Intellisig software definition chain. Two patches with the same name within an Intellisig are treated as the same patch only if they share the same parent definitions, regardless of optional parameters. If the same patch is detected using two different Intellisigs, two separate detected records are created, one for each Intellisig.
Specifies the version label of the patch.
Note: The version label is used to identify the patch together with its name. An empty value is allowed and is treated as a patch with an empty version.
Specifies the optional properties associated with the detected software patch. Following optional properties are available for patches:
Specifies the version number of the patch. Version number is a numeric value separated by dots, for example, 6.1.7600.0.
Specifies the language in which the patch is installed.
Specifies whether the patch uses 32-bit or 64-bit architecture. Valid values include 32 and 64.
Specifies the architecture name that the patch uses. For a complete list of architectures, see Supported Architectures.
Specifies the name of the of the patch manufacturer.
Specifies the name of the patch category.
Specifies the UUID of the of the patch manufacturer.
Specifies the UUID of the patch category.
Specifies the description of the patch.
Return Values
Indicates that the function completed the operation successfully.
Indicates that one or more mandatory parameters passed to the function are blank.
Indicates that the function was unable to write to the file. See the log file for more information.
The CreateDetectedSoftwareReleaseInstance function adds a record to the software detection output file when the script detects an instance of a particular release on the agent computer.
This function has the following format:
CreateDetectedSoftwareReleaseInstance (ProductName as String, ProductVersionLabel as String, ReleaseName as String, ReleaseVersionLabel as String, OptionalProperties as String) as integer
Example: CreateDetectedSoftwareReleaseInstance
CreateDetectedSoftwareReleaseInstance ("Microsoft Windows 7 Ultimate", "6.1", "Microsoft Windows 7 Ultimate x64 64 en-us", "6.1.7600", "Origin=Forward Inc | TrustLevel=5 | InstallPath=C:\Windows | SerialNumber=1234-567-890414-86668 | LastAccessed=2011-11-29:-12:30 |")
Note: This function must be called after calling the CreateDetectedSoftwareRelease function within each script. The CreateDetectedSoftwareReleaseInstance function can be called as many times as there are instances found and each instance will get a separate discovered software record.
Note: If two different Intellisigs detect the same software instance, two discovered software records are created, one for each Intellisig.
Input Parameters
This function has the following input parameters:
Specifies the product name that the release belongs to. You must have called the CreateDetectedSoftwareProduct function for this product within the script.
Specifies the version label of the product.
Specifies the name of the discovered software release.
Specifies the version label of the release.
Specifies the optional properties associated with the discovered software instance. The following optional properties are available for instances:
Specifies the product UUID as detected by the script, which can be, for example the product GUID of an MSI package.
Specifies a unique label for this instance, which can be, for example the Microsoft SQL Server instance name.
Specifies the name of the Intellisig creator.
Specifies the trust level of the creator of the Intellisig, script, or both.
Specifies the path to the product installation directory or the executable on the agent computer.
Specifies the serial number of the instance.
Specifies date and time when the instance was last accessed. Specify the value in the following format: yyyy-mm-dd-hr:mm. This value is assumed to be in local time.
Note: All other functions in dmscript that deal with time also operate in local time. Dmscript converts the time value to Unix format (seconds since 1-1-1970 UTC) before output. DSM Explorer will display this using the local time zone on the machine on which it is running.
Specifies any other custom data you want store for the instance.
Return Values
Indicates that the function completed the operation successfully.
Indicates that one or more mandatory parameters passed to the function are blank.
Indicates that the function was unable to write to the file. See the log file for more information.
The CreateDetectedSoftwarePatchInstance function adds a record to the software detection output file when the script detects an instance of a particular patch on the agent computer.
This function has the following format:
CreateDetectedSoftwarePatchInstance (ProductName as String, ProductVersionLabel, as String, ReleaseName as String, ReleaseVersionLabel as String, PatchName as String, PatchVersionLabel as String, OptionalProperties as String) as integer
Example: CreateDetectedSoftwarePatchInstance
CreateDetectedSoftwarePatchInstance ("Microsoft Windows 7 Ultimate", "6.1", "Microsoft Windows 7 Ultimate x64 64 en-us", "6.1.7600", "KB971033 x64 64 en-us", "", "Origin=Forward Inc |TrustLevel=5 |")
Note: This function must be called after calling the CreateDetectedSoftwarePatch function within each script. The CreateDetectedSoftwarePatchInstance function can be called as many times as there are instances found and each instance will get a separate discovered software record.
Note: If two different Intellisigs detect the same software instance, two discovered software records are created, one for each Intellisig.
Input Parameters
This function has the following input parameters:
Specifies the name of the product that the patch belongs to. You must have called the CreateDetectedSoftwareProduct function for this product within the script.
Specifies the version label of the product.
Specifies the name of the release that the patch belongs to. You must have called the CreateDetectedSoftwareRelease function for this release within the script.
Specifies the version label of the release.
Specifies the name of the detected software patch. You must have called the CreateDetectedSoftwarePatch function for this release within the script.
Specifies the version label of the patch.
Specifies the optional properties associated with the discovered software instance. Following optional properties are available for instances:
Specifies the product UUID as detected by the script, which can be, for example the product GUID of an MSI package.
Specifies a unique label for this instance, which can be, for example the Microsoft SQL Server instance name.
Specifies the name of the Intellisig creator.
Specifies the trust level of the creator of the Intellisig, script, or both.
Specifies the path to the product installation directory or the executable on the agent computer.
Specifies the serial number of the instance.
Specifies date and time when the instance was last accessed. Specify the value in the following format: yyyy-mm-dd:hr:mm. This value is assumed to be in local time. Note that all other functions in dmscript that deal with time also operate in local time. Dmscript converts the time value to Unix format (seconds since 1-1-1970 UTC) before output. DSM Explorer will display this using the local time zone on the machine on which it is running.
Specifies any other custom data you want store for the instance.
Return Values
Indicates that the function completed the operation successfully.
Indicates that the one or more mandatory parameters passed to the function are blank.
Indicates that the function was unable to write to the file. See the log file for more information.
The LogDetectedSoftwareError function writes the error messages to an error log file. The function produces localizable error messages. Call this function to handle errors generated by create functions. The engine reads these error messages and displays it in DSM Explorer.
This function has the following format:
LogDetectedSoftwareError (MessageID as String, Properties as String)
Example: LogDetectedSoftwareError
LogDetectedSoftwareError("ISE:00400","PARAM5=Microsoft Windows 7 Ultimate x64 64 en-us|PARAM6=VersionNumber=6.1.7600 |VersionLabel=6.1.7600 |Language=en-us |Bitness=64 |Architecture=x64 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Product|PARAM7=SWDETECT_BADARGS");
The preceding example code adds the following message to the log file:
Intellisig Microsoft Windows 7 version 6.1.7600, UUID A7C1E14A-7C93-4E17-B4E5-45B796717F49, script win7.xml, Failed to create software product. The parameters were ProductName:Microsoft Windows 7 Ultimate x64 64 en-us OptionalProperties : VersionNumber=6.1.7600 |VersionLabel=6.1.7600 |Language=en-us |Bitness=64 |Architecture=x64 |Manufacturer=Microsoft Corporation|Category=Operating Systems |Description=The Microsoft Windows 7 Product. Return Code : SWDETECT_BADARGS
Input Parameters
This function has the following input parameters:
Specifies the error code. For more information about available error codes, see Error Codes and Optional Properties.
Specifies a list of properties that are required to create a formatted message string. Typically, you specify the parameters passed to the respective create functions that you are handling. The parameters must match the error text. For the exact error text and function syntax, see Error Codes and Optional Properties. The error text uses PARAM1 to PARAM8 to create the message string. If the string does not contain param, value pairs, the string is displayed as-is. The parameters PARAM1 to PARAM4 are automatically assigned to the following values:
The values for parameters PARAM5 to PARAM8 differ depending on the create function you are handling. For example, if you are handling the failure of the CreateDetectedSoftwareProduct function, following are the error code and text:
Error code: ISE:00400
Error text: Intellisig %1$t version %2$t, UUID %3$t, script %4$t, Failed to create software product. The parameters were ProductName:%5$t OptionalProperties : %6$t. Return Code : %7$t
In this example, PARAM5 specifies the product name, PARAM6 specifies optional properties, and PARAM7 specifies the return code.
The CloseDetectedSoftwareOutputFiles function closes the files opened by the OpenDetectedSoftwareOutputFiles function.
This function has the following format:
CloseDetectedSoftwareOutputFiles() as integer
Return Values
Indicates that the function completed the operation successfully.
Indicates that the function was unable to close the file. See the log file for more information.
|
Copyright © 2013 CA.
All rights reserved.
|
|