Kaspersky Security Center Automation  10.0
HRESULT IKlAkPolicies::CopyOrMovePolicy ( [in] long  nPolicyId,
[in] IKlAkParams pPolicy,
[in] VARIANT_BOOL  bMove,
[in] long  nNewGroupId,
[out, retval] long *  pnPolicyId 
)

Copy/move policy.

Copies or moves specified policy

Parameters:
nPolicyId policy id
pPolicy collection of policy attributes Following attributes may be specified (Administration Server earlier than 5 MP 3 ignores these attributes)
  • KLPOL_DN -- display name of new policy
  • KLPOL_ACTIVE -- new policy will become active policy if true
bMove moves policy if true, copies policy otherwise
nNewGroupId destination group id
Return values:
pnPolicyId id of new policy


See JScript call sample below.
Copies policy with id, makes its copy inactive and but it into root group Groups.

	var oProps = new ActiveXObject("klakaut.KlAkParams");
	oProps.Add("KLPOL_DN", "blah-blah-blah");
	oProps.Add("KLPOL_ACTIVE", false);
	var idNewPolicy = oPolicies.CopyOrMovePolicy( idPolicy, oProps, false, oGroups.GroupIdGroups);