IWSManSession::Create method (wsmandisp.h)

Creates a new instance of a resource and returns the endpoint reference (EPR) of the new object.

Syntax

HRESULT Create(
  [in]  VARIANT resourceUri,
  [in]  BSTR    resource,
  [in]  long    flags,
  [out] BSTR    *newUri
);

Parameters

[in] resourceUri

The identifier of the resource to create.

This parameter can contain one of the following:

[in] resource

An XML string that contains resource content.

[in] flags

Reserved. Must be set to 0.

[out] newUri

The EPR of the new resource.

Return value

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

Remarks

IWSManSession::Create is only used for creating new instances of a resource. Use the IWSManSession::Put method to update existing instances of a resource. After you obtain the new resource URI, you can call IWSManSession::Get to retrieve the new object. The new object contains any properties that the resource provider assigns when creating the new object. For example, if you create a new WS-Management protocollistener and retrieve the listener object using Session.Get, then you also obtain the Port, Enabled, and ListeningOn properties.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wsmandisp.h
Library WSManDisp.tlb
DLL WSMAuto.dll

See also

IWSManSession

Session.Create