Manage Surface Dock 2 with WMI

Windows Management Instrumentation (WMI) support provides a rich set of diagnostic information enabling IT admins to remotely monitor and manage the latest firmware, policy state, and related data across Surface Dock 2 devices. You can use WMI with Windows PowerShell, System Center Operations Manager, and other tools. For more information about WMI, see Working with WMI.

To enable WMI support, go to Surface Dock 2 Drivers and Firmware and download the appropriate package:

SurfaceDock2_WmiInstanceProvider_Win10_17763_<Version>_x64.msi:

  • Surface Pro (5th Gen and later)
  • Surface Book (2nd Gen and later)
  • Surface Go (all generations)
  • Surface Laptop (all generations)
  • Surface Laptop Go (all generations)

SurfaceDock2_WmiInstanceProvider_Win10_17763_<Version>_arm64.msi:

  • Surface Pro X

Using WMI with Surface Dock 2

  1. To enumerate all dock component instances:

    Get-CimInstance -Namespace "root/Surface" -Class "SurfaceDockComponent" 
    
  2. To access WMI Class Property descriptions, open a command prompt and enter WMI commands where Property is one of the properties listed in Table 1.

     Get-CimClass -Namespace "root/Surface" -Class "SurfaceDockComponent").CimClassProperties["<Property>"]
    
  • Example: To access the description for the Version Common Information Model (CIM) property, enter the following:
    (Get-CimClass -Namespace "root/Surface" -Class "SurfaceDockComponent").CimClassProperties["Version"].Qualifiers["Description"].Value
    

Table 1. Surface Dock 2 WMI reference

Property Type Expected Value(s) Description
ComponentName String “Microcontroller”
“USB Hub 1”
“USB Hub 2”
“Display Port Hub”
“Power Delivery Controller”
“Audio Codec”
“Ethernet Controller”
The following property lists the specific name of the device component that the accompanying Common Information Model (CIM) class data corresponds to.
DeviceName String “Surface Dock 1”
“Surface Dock 2”
The following property contains the name of the dock device that the specific device component belongs to.
DockSerialNumber String A twelve (12) digit serial number containing only numerical values The following property records the serial number of the attached dock device. This serial number is the exact same for every component as they belong to the same dock device. For reference, this serial number can be found physically on the underside of the Surface Dock itself.
Id uint16 0, 1, 2, ..., 65535 The following property is a unique Id that starts from zero (0) and counts up. This variable is used for numbering the enumerated WMI instances.
LastUpdateStatus String “Success”
“PendingDockReattach”
“Failed”
The following property details the last attempted Component Firmware Update (CFU) status for the device component in question. Possible values are: Success, Pending Dock Reattach, and Failed.


- Success indicates that previously applied new firmware was applied successfully
- Pending Dock Reattach indicates there is a new update pending for the device component and the user must detach and reattach the Dock’s Surface connector in order to apply the new update.
- Failed indicates that a possible legitimate error occurred during the CFU process or the peripheral did not boot up in the expected version. In the Failed case, this is not an indication that the device is not working, but rather something erroneous occurred when trying to update the device. In such case, the previous firmware will continue to run.
PolicyState String “Enabled”
“Disabled”
The following property indicates the current Surface Enterprise Management Mode (SEMM) policy for the device component. Possible values are: Enabled and Disabled.


- Enabled indicates that the SEMM system has allowed the host device to access and use the device component
- Disabled indicates that the SEMM system has disallowed and thereby prevented the host machine from accessing and using the device component.
ProductId String[] A list of hex strings, which can each range from “0x0000” to “0xFFFF” The following property classifies the Product Id (PID) of the device component. It is possible for there to be more than one PID listed. In the case of a USB Hub, for example, both Super Speed (SS) and High Speed (HS) devices are lumped into a singular “Hub." Therefore, two (2) PIDs would be listed within this array.
ProvisionedState boolean True or False The following property describes the Surface Enterprise Management Mode (SEMM) provisioned state of the Surface Dock device. The provisioned state is the exact same for every component as they belong to the same dock device. Possible values are: True or False. A value of true indicates the Surface Dock device is currently managed and thereby, port functionality may be restricted. See the “PolicyState” property field for more information. A value of false indicates the Surface Dock device is currently not managed and has no feature restrictions imposed.
Status String “OK”
“Disconnected”
“Error”
“Missing”
“DeviceHandleInUse”
“Disabled”
“NotSupportedByWmi”
The following property describes the state of the Dock’s connection to the host machine. Possible values are: OK, Disconnected, Error, Missing, DeviceHandleInUse, Disabled, and NotSupportedByWmi.
- OK indicates that the device is successfully connected to the host machine and no problems exist, which would inhibit its functionality
- Disconnected indicates that the Surface connector, which provides the connection for all the device components, is currently not attached to the host machine.
- Error indicates a potential issue with the device instance and the device interface has more than likely been labeled with a yellow exclamation point in the Device Manager – check the StatusCode property for more detailed information on the type of error that occurred.
- Missing indicates that the device was expected to have enumerated on the host machine, but for some reason did not. The StatusCode property will hold the value of 24 to indicate this erroneous situation.
- DeviceHandleInUse indicates that another process is currently communicating with the device, which prohibits this Windows Management Instrumentation (WMI) Instance Provider from its communication requests. Try executing your WMI command again!
- Disabled indicates that the current Surface Enterprise Management Mode (SEMM) policy has disallowed and thereby prevented the host machine from accessing and using the device component. See the PolicyState property field for more information.
- NotSupportedByWmi indicates the connected dock is currently not supported by this WMI Provider. This status will appear for the Surface Dock 1, which is currently not supported by this WMI Instance Provider.
StatusCode uint32 Device Manager Error Code obtained from the CIM_LogicalDevice WMI Class (within cimwin32.mof) The following property provides the Device Manager error code for the given dock component. A value of zero (0) indicates that the dock component is working correctly; a value greater than zero (0) indicates an issue or a possible error with the dock component. Because the dock component may enumerate with several device interfaces, it is possible there may be additional Device Manager error codes. This property field only lists a single error code even if multiple are available. The Device Manager will label the device with a yellow exclamation point only when certain error codes have occurred.
VendorId String A hex string that can range from “0x0000” to “0xFFFF” The following property notes the specific Vendor Id (VID) of the device component.
Version String A version string, which has the form as follows: “x.y.z”, where x, y, and z are numerical values. The following property specifies the current version of the firmware, which is currently running on the device component.

Learn more