IWSManSession::Create method

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

resourceUri [in]

The identifier of the resource to create.

This parameter can contain one of the following:

resource [in]

An XML string that contains resource content.

flags [in]

Reserved. Must be set to 0.

newUri [out]

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WSManDisp.h

IDL

WSManDisp.idl

Library

WSManDisp.tlb

DLL

WSMAuto.dll

See also

IWSManSession
Session.Create

 

 

Show: