Skip to content

Latest commit

 

History

History
132 lines (99 loc) · 4.72 KB

nf-wsmandisp-iwsman-createsession.md

File metadata and controls

132 lines (99 loc) · 4.72 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:wsmandisp.IWSMan.CreateSession
IWSMan::CreateSession (wsmandisp.h)
Creates a Session object that can then be used for subsequent network operations.
CreateSession
CreateSession method [Windows Remote Management]
CreateSession method [Windows Remote Management]
IWSMan interface
IWSMan interface [Windows Remote Management]
CreateSession method
IWSMan.CreateSession
IWSMan::CreateSession
winrm.iwsman_createsession
wsmandisp/IWSMan::CreateSession
winrm\iwsman_createsession.htm
winrm
0ccab9bf-f8b4-432e-92d1-b5a5d3a2dfe5
12/05/2018
CreateSession, CreateSession method [Windows Remote Management], CreateSession method [Windows Remote Management],IWSMan interface, IWSMan interface [Windows Remote Management],CreateSession method, IWSMan.CreateSession, IWSMan::CreateSession, winrm.iwsman_createsession, wsmandisp/IWSMan::CreateSession
wsmandisp.h
Windows
Windows Vista
Windows Server 2008
WSManDisp.idl
WSManDisp.tlb
WSMAuto.dll
Windows
19H1
IWSMan::CreateSession
wsmandisp/IWSMan::CreateSession
c++
APIRef
kbSyntax
COM
WSMAuto.dll
IWSMan.CreateSession

IWSMan::CreateSession

-description

Creates a Session object that can then be used for subsequent network operations.

-parameters

-param connection [in]

The protocol and service to connect to, including either IPv4 or IPv6. The format of the connection information is as follows: <Transport><Address><Suffix>. For examples, see Remarks. If no connection information is provided, the local computer is used.

-param flags [in]

The session flags that specify the authentication method, such as Negotiate authentication or Digest authentication, for connecting to a remote computer. These flags also specify other session connection information, such as encoding or encryption. This parameter must contain one or more of the flags in __WSManSessionFlags for a remote connection. For more information, see Session Constants. No flag settings are required for a connection to the WinRM service on the local computer.

If no authentication flags are specified, Kerberos is used unless one of the following conditions is true, in which case Negotiate is used:

  • explicit credentials are supplied and the destination host is trusted
  • the destination host is "localhost", "127.0.0.1" or "[::1]"
  • the client computer is in a workgroup and the destination host is trusted
For more information, see Authentication for Remote Connections and the connectionOptions parameter.

-param connectionOptions [in]

A pointer to an IWSManConnectionOptions object that contains a user name and password. The default is NULL.

-param session [out]

A pointer to a new IWSManSession object.

-returns

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

-remarks

The following list contains examples of formats used to specify connection information in the connection parameter (when creating an HTTPS session, the <Address> field must match the server computer certificate name, otherwise a failure occurs):

  • "https://service"

    Uses HTTPS to connect to the default web service location.

  • "https://service.corp.com/websvcs/wsman"

    Uses HTTPS to connect to the specific web service location.

  • "https://[E3D7:0000:0000:0000:51F4:9BC8:C0A8:6420]"

    Uses HTTPS and IPv6 with the default port.

  • "https://[E3D7:0000:0000:0000:51F4:9BC8:C0A8:6420]:9999/wsman"

    Uses HTTPS and IPv6 with the given port.

-see-also

IWSMan

WSMan.CreateSession