VB Script to set a Custom Property in AM 704

0 Likes
over 11 years ago

This is a VB Script that can set a single custom property for a single server in AppManager V704. It works by connecting to the Control Center SQL Server and invoking a stored procedure in the database. There are several input parameters for this script:-


/server:  The SQL Server that the Control Center Database is located on (default is localsystem)
/db:      The Control Center Database Name (default is CCDB)
/uid:     The SQL Login to use (if not specified, Windows Authentication is used)
/pwd:     The SQL password if SQL authentication is used
/target:  The target server (to apply the Property on). No default. Required.
/cp_name: The name of the Custom Property. No default. Required.
/cp_type: The type (0 for String, 1 for Integer, 2 for Float). Default is 0 (string)
/cp_val:  The value to set. No default. Required.
/cp_ds:   The DataSource for the target server in the form SERVER.DATABASE


If the DataSource (the name of the QDB which holds the target server) is not specified then the script will try to locate the DataSource. If the target server is in multiple Repositories then you must specify the DataSource to use.


This is just an unsupported example VB Script for setting a custom property in AM7. The routine "SetProperty" is what does the actual work - the rest of the script is just validating what was entered. An example use is:-


cscript AMSetCustomProperty /server:MYCCDBSERVER /target:AGENT1 /cp_name:MYCP /cp_type:0 /cp_val:"My New Value"



NetIQ does not test or validate any software, code or other materials provided in, on or through NetIQ Cool Solutions (collectively, "Materials"), so please use caution when downloading or accessing any Materials from Cool Solutions and ensure that you have reasonable and current security, spyware and anti-virus measures in place on your computer and/or network prior to downloading. Additionally, do not use any Materials downloaded from Cool Solutions in any production environment without first testing the Materials to ensure they are compatible with your version of NetIQ software or any other hardware or software present in your network or environment. Cool Solutions is not a substitute for authorized NetIQ support and should not be used as such. NETIQ COOL SOLUTIONS AND ANY MATERIALS ARE PROVIDED ON AN AS-IS, AS-AVAILABLE BASIS WITHOUT ANY WARRANTY OF ANY KIND. By downloading this file, you are agreeing to these terms of use. To report a problem please contact: coolguys-netiq@netiq.com. Your use of Cool Solutions is governed by the Cool Solutions Terms and Conditions. https://www.netiq.com/communities/coolsolutions/terms-and-conditions/

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended