DevicesManager.ReportDevice Method (String, Guid, String, DeviceIdentityStatus, String)

 

Reports when a new device is added; or when a name, or identity status of a device is updated.

Namespace:   Microsoft.WindowsServerSolutions.Common.Devices
Assembly:  DevicesOM (in DevicesOM.dll)

Syntax

public void ReportDevice(
    string deviceId,
    Guid deviceType,
    string deviceName,
    DeviceIdentityStatus status,
    string additionalIdInfo
)
public:
void ReportDevice(
    String^ deviceId,
    Guid deviceType,
    String^ deviceName,
    DeviceIdentityStatus status,
    String^ additionalIdInfo
)
Public Sub ReportDevice (
    deviceId As String,
    deviceType As Guid,
    deviceName As String,
    status As DeviceIdentityStatus,
    additionalIdInfo As String
)

Parameters

  • deviceId
    Type: System.String

    The identifier of the device to be reported.

  • deviceType
    Type: System.Guid

    The type of the device to be reported.

  • deviceName
    Type: System.String

    The name of the device to be reported.

  • additionalIdInfo
    Type: System.String

    The additional identity information, which is the certificate serial number.

Exceptions

Exception Condition
ArgumentNullException

The argument is null or empty.

ArgumentException

The deviceType is Guid.Empty.

DevicesProviderAccessDeniedException

The caller is not a local administrator.

DevicesProviderNotAvailableException

The object model is not connected to the devices provider.

DeviceTypeMismatchedException

The deviceType does not match the existing device.

DevicesProviderException

The reason the device could not be removed.

Remarks

Administrator rights are required to perform this operation.

Only devices with a device type from DeviceTypes are listed in the Dashboard.

Examples

The following code example shows how to report a device.

using (DevicesManager dm = new DevicesManager())
{
  string deviceId = Guid.NewGuid().ToString();
  Guid deviceType = Constant.MyDeviceType;
  dm.ReportDevice(deviceId,
                  deviceType,
                  "SDK Device",
                  DeviceIdentityStatus.Active,
                  null);
}

See Also

DeviceTypes
DeviceIdentityStatus
ReportDevice Overload
DevicesManager Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace

Return to top