A resource URI is an identifier for a distinct type of management operation or value used by management services that implement the WS-Management protocol. A management value could be the temperature inside a computer. An example of a management operation is starting a stopped service or setting a disk volume user quota.
Resource URI Format
A URI consists of a prefix and a path to a resource as is shown in the following example:
This schema specification indicates that the URI is based on version 1 of the official WS-Management protocol and that the resource is a Win32_LogicalDisk in the "root\cimv2" namespace of the WMI repository. URI prefixes contain a schema specification, such as "schemas.microsoft.com/wbem/wsman/1/wmi" and a specific type of resource, such as Win32_LogicalDisk. For more information about identifying a specific instance of a WMI class, see Windows Remote Management and WMI.
For more information, see URI Prefixes.
Types of Resource URIs
While Windows Management Instrumentation (WMI) is the primary source of management data for Windows-based operating systems, other sources of management schema also exist.
The following list describes several types of resource URIs used by Windows Remote Management:
This group of URIs represent a Common Information Model class path which includes namespace and class.
WMI URIs can be used in:
An example is https://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor.xsd. This resource is defined according to the DMTF.org CIM schema.
WinRM configuration URIs
This group of URIs are configuration operations for the WinRMlistener configuration.
System Event Log (SEL) URIs
This group of URIs subscribes to Event Collector events from the BMC. You can subscribe to these events using the Wevtutil command-line tool. For more information, see https://schemas.microsoft.com/wbem/wsman/1/logrecord/sel.
The WMI plug-in preserves the case of the resource URI received in a request. However, to ensure interoperability with other implementations of WS-Management protocol, use the correct case for the requested resource in resource URI. The correct case is the spelling defined by the resource provider.
While resource URIs do not require case-sensitivity, fragment XML does. A fragment specifies just one property, rather than the entire set of properties for a resource. In the case of WMI resources, fragment syntax gets one property from a resource instance. For example, getting only the Version property from Win32_OperatingSystem requires using a fragment. For more information about fragments, see "Adding a selector to a ResourceLocator or IWSManResourceLocator object" in Windows Remote Management and WMI.
Following XML and XPath standards, the WMI plug-in enforces case-sensitivity for fragments and XML that defines the input parameters for a method. Case-sensitivity is required to support the XPath 1.0/Level 1 standard. To get WMI data through WinRM, case-sensitivity means that the names of WMI classes, properties, and methods must match the case of the name found in the WMI repository.
For more information, see XPath Syntax.
Case Sensitivity Examples
For example, a script that obtains the SECURITY_DESCRIPTOR property from an instance of the WMI Win32_Service class cannot use upper-case for the names in the fragment path, only the URI. The WinRM WMI plug-in returns an error for the following VBScript example because the XPath XML supplied for the FragmentPath does not use the correct case. In the WMI repository, the class is spelled "Win32_Service".
RResourceUri = "http://schemas.microsoft.com/wbem/wsman/1/"_& "wmi/root/cimv2/Win32_Service?Name=winrm" Set WSMan = CreateObject("WSMan.Automation") Set Locator = WSMan.CreateResourceLocator(Resourceuri) Locator.FragmentPath = "/Win32_SERVICE/Name" Set Session = WSMan.Createsession xml = Session.Get(Locator) WScript.Echo xml
The following version of the same example shows the correct use of case for the Win32_Service class and SECURITY_DESCRIPTOR property.
ResourceUri = "http://schemas.microsoft.com/wbem/wsman/1/"_ & "wmi/root/cimv2/Win32_Service?Name=winrm" Set WSMan = CreateObject("WSMan.Automation") Set Locator = WSMan.CreateResourceLocator(Resourceuri) Locator.FragmentPath = "/Win32_Service/Name" Set Session = WSMan.Createsession xml = Session.Get(Locator) WScript.Echo xml