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:
- URI with one or more selectors. Be aware that the WMI plug-in does not support creating any resource other than a WS-Management protocol listener.
- ResourceLocator object which may contain selectors, fragments, or options.
- WS-Addressing endpoint reference as described in the WS-Management protocol standard. For more information about the public specification for the WS-Management protocol, see Management Specifications Index Page.
[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 |