WSManGetSessionOptionAsString function (wsman.h)

Gets the value of a session option.

Syntax

DWORD WSManGetSessionOptionAsString(
  [in]            WSMAN_SESSION_HANDLE session,
                  WSManSessionOption   option,
                  DWORD                stringLength,
  [out, optional] PWSTR                string,
  [out]           DWORD                *stringLengthUsed
);

Parameters

[in] session

Specifies the session handle returned by a WSManCreateSession call. This parameter cannot be NULL.

option

Specifies the option to get. Not all session options can be retrieved. The values for the options are defined in the WSManSessionOption enumeration.

stringLength

Specifies the length of the storage location for string parameter.

[out, optional] string

A pointer to the storage location for the value of the specified session option.

[out] stringLengthUsed

Specifies the length of the string returned in the string parameter.

Return value

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

Requirements

Requirement Value
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
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