WSManCreateShellEx function

Creates a shell object by using the same functionality as the WSManCreateShell function, with the addition of a client-specified shell ID. The returned shell handle identifies an object that defines the context in which commands can be run. The context is defined by the environment variables, the input and output streams, and the working directory. The context can directly affect the behavior of a command. A shell context is created on the remote computer specified by the connection parameter and authenticated by using the credentials parameter.

Syntax


void WINAPI WSManCreateShellEx(
  _Inout_   WSMAN_SESSION_HANDLE session,
  DWORD flags,
  _In_      PCWSTR resourceUri,
  _In_      PCWSTR ShellID,
  _In_opt_  WSMAN_SHELL_STARTUP_INFO *startupInfo,
  _In_opt_  WSMAN_OPTION_SET *options,
  _In_opt_  WSMAN_DATA *createXml,
  _In_      WSMAN_SHELL_ASYNC *async,
  _Out_     WSMAN_SHELL_HANDLE *shell
);

Parameters

session [in, out]

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

flags

Reserved for future use. Must be 0.

resourceUri [in]

Defines the shell type to create. The shell type is defined by a unique URI. The actual shell object returned by the call is dependent on the URI specified. This parameter cannot be NULL. To create a Windows cmd.exe shell, use the WSMAN_CMDSHELL_URI resource URI.

ShellID [in]

The client specified shellID.

startupInfo [in, optional]

A pointer to a WSMAN_SHELL_STARTUP_INFO structure that specifies the input and output streams, working directory, idle timeout, and options for the shell. If this parameter is NULL, the default values will be used.

options [in, optional]

A pointer to a WSMAN_OPTION_SET structure that specifies a set of options for the shell.

createXml [in, optional]

A pointer to a WSMAN_DATA structure that defines an open context for the shell. The content should be a valid XML string. This parameter can be NULL.

async [in]

Defines an asynchronous structure. The asynchronous structure contains an optional user context and a mandatory callback function. See the WSMAN_SHELL_ASYNC structure for more information. This parameter cannot be NULL and should be closed by calling the WSManCloseShell method.

shell [out]

Defines a shell handle that uniquely identifies the shell object. The resource handle is used to track the client endpoint for the shell and is used by other WinRM methods to interact with the shell object. The shell object should be deleted by calling the WSManCloseShell method. This parameter cannot be NULL.

Return value

This function does not return a value.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Wsman.h

Library

WsmSvc.lib

DLL

WsmSvc.dll

 

 

Show:
© 2014 Microsoft