Collect connected Hardware with Endpoint Analytics

To see which devices are using a particular monitor or keyboard, it can be very helpful if you can collect this information. In this blog I will show you how to do this with the help of Endpoint Analytics. You can then use this information to assign a driver to these devices or to trigger a hardware replacement. How you can automatically populate a group based on the output of an endpoint analytics script I explained in this blog post.

How to get the Hardware Id

Run the following command in a PowerShell session

Get-PnpDevice | Format-List

Search the hardware you want to collect and copy the DeviceID:

Insert the DeviceId or multiple DeviceIds into the array in the PowerShell script from my github repository:

Deploy a Endpoint Analytics Script to collect the values

First we deploy an endpoint analytics script to our clients to get the return value from the clients with the device manufacture

  • Enter a name and click Next
  • Upload the Detection script. You can find this script in my GitHub repository.
  • Click Next > Next
  • Assign the script to a group
  • Create a schedule. In my case I select daily.
  • Click Next > Create

Result

You can see in the  Device status view of the remediation script the result.

  • With issues = device fount
  • Without issues = device not fount

You can get the results also via graph:

https://graph.microsoft.com/beta/deviceManagement/deviceHealthScripts/**SCRIPT_ID**/deviceRunStates?$top=100

How to fill a AAD group based on this value you can find here.

2 thoughts on “Collect connected Hardware with Endpoint Analytics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s