ComplianceJob - addNamedServerToJobByJobDBKey


ComplianceJob - addNamedServerToJobByJobDBKey

Description :

This command adds a server to an existing Compliance Job. You can also perform the same action with Job : addTargetServer .

The complianceKey argument provides a DBKey referring to the Compliance Job to be modified. The serverName argument identifies the target server to be added.

This command returns a handle to the updated Compliance Job. Note that this handle is different than any existing handle to this Compliance Job. All older handles are invalid.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

complianceKey

DBKey

Handle to the Compliance Job.

serverName

String

Name of the server to be added.

Example

The following example shows you how to add a server to an existing Compliance Job.

Script


# Name of the existing Compliance Job.

COMPLIANCEJOB_NAME="compliancejob1"

# Job group in which the  Compliance Job is stored.

COMPLIANCEJOB_GROUP="/parent/group1"

# Get the Compliance Job DBKey using the above information.

COMPLIANCEJOB_DBKEY=`blcli ComplianceJob getDBKeyByGroupAndName $COMPLIANCEJOB_GROUP $COMPLIANCEJOB_NAME`

# Name of the existing server.

SERVER_NAME="server1"

#Now add the server to the Compliance Job.

COMPLIANCEJOB_DBKEY=`blcli ComplianceJob addNamedServerToJobByJobDBKey $COMPLIANCEJOB_DBKEY $SERVER_NAME`

# Use the returned DBKey to add more servers to the Compliance Job.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Server Automation Command Line Interface 8.7