WSManInitialize function (wsman.h)

Initializes the Windows Remote Management Client API. WSManInitialize can be used by different clients on the same process.


DWORD WSManInitialize(
        DWORD            flags,
  [out] WSMAN_API_HANDLE *apiHandle



A flag of type WSMAN_FLAG_REQUESTED_API_VERSION_1_0 or WSMAN_FLAG_REQUESTED_API_VERSION_1_1. The client that will use the disconnect-reconnect functionality should use the WSMAN_FLAG_REQUESTED_API_VERSION_1_1 flag.

[out] apiHandle

Defines a handle that uniquely identifies the client. This parameter cannot be NULL. When you have finished used the handle, close it by calling the WSManDeinitialize method.

Return value

This method returns zero on success. Otherwise, this method returns an error code.


Minimum supported client Windows 8
Minimum supported server Windows Server 2012
Target Platform Windows
Header wsman.h
Library WsmSvc.lib
DLL WsmSvc.dll
Redistributable Windows Management Framework on Windows Server 2008 with SP2 and Windows Vista with SP2