URI prefixes
The resource URI prefix is different depending on which XML schema describes the resource.
Prefixes
If you access a CIM 2.1 class, such as CIM_DataFile, the prefix of the URI differs from the prefix for a CIM 2.9 class, such as CIM_AdminDomain. CIM 2.1 classes are documented in the CIM Classes section of Windows Management Instrumentation (WMI).
Most WMI classes are in the root\cimv2 WMI namespace. Classes for the Microsoft Intelligent Platform Management Interface (IPMI) provider are in root\hardware.
The following list contains the resource URI prefixes for these schemas:
WMI or CIM 2.1 classes in the root\cimv2 namespace
"http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/"
CIM 2.9 classes or IPMI classes
"https://schemas.dmtf.org/wbem/wscim/1/cim-schema/2"
Alternate way to access IPMI provider classes
"http://schemas.microsoft.com/wbem/wsman/1/wmi/root/hardware/"
For more information, see Resource URIs and UrlPrefix Strings. For more information about generating a URI for a WMI class or method, see Windows Remote Management and WMI.
Prefix Aliases
A prefix alias is a shortcut that represents the long resource URI prefix. You can also use aliases in the Winrm command-line. To view a list of available aliases, type Winrm help aliases.
Be aware that an alias cannot be used inside an endpoint reference (EPR) when specifying a resource URI. Windows Remote Management is unable to expand the alias when it is embedded in XML.
In the following code example, the winrm alias is used in an EPR instead of the complete resource URI, which is http://schemas.microsoft.com/wbem/wsman/1/config/Listener
. In this case, WinRM returns an error that indicates the service cannot process the request.
ResourceUri = "</wxf:ResourceCreated>.....
<w:ResourceURI>winrm/config/listener</w:ResourceURI>...
</w:SelectorSet></a:ReferenceParameters></wxf:ResourceCreated>"
Set ResourceLocator = WSManObj.CreateResourceLocator(resourceUri)
ResponseStr = Session.Get(ResourceLocator, 0)
The following lists defined aliases and resource URIs for which they substitute.
-
wmi
-
http://schemas.microsoft.com/wbem/wsman/1/wmi
-
wmicimv2
-
http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2
-
cimv2
-
https://schemas.dmtf.org/wbem/wscim/1/cim-schema/2
-
winrm
-
http://schemas.microsoft.com/wbem/wsman/1
-
wsman
-
http://schemas.microsoft.com/wbem/wsman/1
-
shell
-
http://schemas.microsoft.com/wbem/wsman/1/windows/shell