DevicesManager.ReportDevice Method (Guid, ReportDeviceParameters)
Reports when a new device is added; or when a name, or an identity status of a device is updated.
Namespace: Microsoft.WindowsServerSolutions.Common.Devices
Assembly: DevicesOM (in DevicesOM.dll)
Syntax
public void ReportDevice(
Guid deviceType,
ReportDeviceParameters parameters
)
public:
void ReportDevice(
Guid deviceType,
ReportDeviceParameters^ parameters
)
Public Sub ReportDevice (
deviceType As Guid,
parameters As ReportDeviceParameters
)
Parameters
deviceType
Type: System.GuidThe type of the device to be reported.
parameters
Type: Microsoft.WindowsServerSolutions.Common.Devices.ReportDeviceParametersThe parameters that are necessary for reporting a device.
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;
ReportDeviceParameters reportParameters =
new ReportDeviceParameters(deviceId,
"SDK Device",
DeviceIdentityStatus.Active,
null);
dm.ReportDevice(deviceType, reportParameters);
}
See Also
DeviceTypes
DeviceIdentityStatus
ReportDevice Overload
DevicesManager Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace
Return to top