Many administrators looking to automate the time consuming process, I had seen requests in HP support forums on how to change agent in bulk
I have created the below script which utilizes Policy Management and Deployment (PMAD) API which mainly starts by
We can compare the above lines by opening the Node Editor
The line above is locating or creating a node typically like Selecting the node you will modify the agent attributes.
The lines above is like right click the node and select Change Agent which is executed by ChangeAgent() function which should be formatted like ChangeAgent(lAgtType,lBinaryFormat,ulOptions,sUser,sPwd)
- Defines the communication type of the HP Operations agent (DCE or HTTPS) that should run on the node.
- Defines the binary format of the HP Operations agent that should run on the node.
- Defines the type of authentication that will be used for the operation
- PMAD_DEPL_NONE_OPT - This flag cannot be combined with any other flags. Use this flag when you do not want to pass any other flags.
- PMAD_DEPL_IGNORE_OWNER_OPT - If this flag is NOT SET, the operation fails if some policies are owned by another management server. If this flag if SET, the owner attribute of the policies is ignored.
- PMAD_DEPL_FORCE_OPT - If this flag is NOT SET, the operation fails whenever there are policies in the inventory on the server for which no data is available. However, if this flag is SET, policies with no data are ignored (that is, not deployed again).
- PMAD_DEPL_IMPERSONATE_OPT - If SET, the remote managed node is accessed with the security context of the impersonated user (the user that called this API).
- PMAD_DEPL_PMADUSER_OPT - If SET, the remote managed node is accessed with the security context of the HP-OVE-Deleg-User account (the one under which PMAD is running).
Which I chose PMAD_DEPL_IMPERSONATE_OPT which uses the current user this options has a hex value 0x100 and the ulOptions means unsigned long which means a non negative decimal value which means here 256
- Name of the account used to access the remote node. You can specify the account either as a user principal name (UPN such as UserName@DomainName) or in the down-level log-on name format (DomainName\UserName).
- Password of the account used to access the remote node.
The Full script