KSC Open API  13.1
Kaspersky Security Center API description
wstring NagRdu::SetProductStateAsync ( wstring  szwProductID,
int  nNewState 
)

Asynchronously starts, restarts, or stops a specific product.

Parameters:
szwProductIDproduct ID. Taken from the container of the current host state.
nNewStatenew state of a specific product. Accepts one of the following values:
  • 0 means start.
  • 1 means restart.
  • 2 means stop.
Returns:
ID of an asynchronous request. Use this ID to get the result with current host state.
Remarks:
To check the state of the specific product start, restart, or stop procedure, call AsyncActionStateChecker::CheckActionState periodically until the procedure is completed. If the procedure succeeds, AsyncActionStateChecker::CheckActionState returns the current host state in pStateData. Otherwise, the AsyncActionStateChecker::CheckActionState call returns an error in pStateData.
Exceptions:
Thefunction throws an exception in case of an error.