There have been a number of recent interesting developments in Windows 10 support in Workspace ONE UEM with Baselines and Peer-to-Peer software distribution rightfully taking the limelight. However, in this blog, I’d like to shine a light on a very powerful feature that has not been given the attention I believe it deserves.

Sensors are a way of gathering an incredible amount of information about an enrolled Windows 10 device. Using standard WIMIC scripts the shackles are off when it comes to analysing our Windows 10 estate and when you couple this with the power of Workspace ONE Intelligence Automation it becomes possible to not only have information but act upon it using the integrations with Workspace ONE UEM, ServiceNow and Slack.

So without any further ado let’s create a sensor and see what we can do. In this example, I want to determine the types of chassis my enrolled devices are housed in. This may be because I need to simply tell the difference between a mobile platform like a laptop and a static one like a desktop or it could be because I have specialised devices in my environment like this Lunch Box chassis and I need to identify them for specific profiles or app deployments.

Image result for lunch box chassis windows
Yeah, I had no idea what a lunchbox chassis was either…

In the UEM console we need to navigate first to Devices –> Provisioning –> Custom Attributes –> Sensors. Clicking Add and then Windows will start the process of adding a new Sensor.

The naming must be a minimum of 2 characters, a max of 64 and start with a lowercase alpha character. Don’t worry about remembering this though as the validation checks will make sure you don’t misname your sensor. This is the name that we will see in Intelligence so I recommend using a name that is as descriptive as possible. A description could also be a sensible idea at this point though it isn’t required.

The value types determine the type of data we are expecting to get back, so if you’re not sure run your script manually and see what it outputs first. Our options here are String, Integer, Boolean (True\False) and Date Time – in this example, we are going to use a String.

Finally, we need to determine when the sensor will trigger, either on a schedule (determined by the settings in the Windows Sample Schedule) or on a specific Event such as Login, Logout, Startup or User Switch. For now, I’m going to stick to a schedule.

Once we click next we can select the context we want to execute the script which is either System or User and will need to be appropriate for the information you want to gather. Then we can upload a script or type one into the box on the screen. I’ve chosen the latter and the script I’m using is here.

function check-chassis {
$computer = “$_”
$chassis = Get-WmiObject win32_systemenclosure -computer $computer | select chassistypes
if ($chassis.chassistypes -contains ‘3’){Write-Output “Desktop”}
elseif ($chassis.chassistypes -contains ‘4’){Write-Output “Low Profile Desktop”}
elseif ($chassis.chassistypes -contains ‘5’){Write-Output “Pizza Box”}
elseif ($chassis.chassistypes -contains ‘6’){Write-Output “Mini Tower”}
elseif ($chassis.chassistypes -contains ‘7’){Write-Output “Tower”}
elseif ($chassis.chassistypes -contains ‘8’){Write-Output “Portable”}
elseif ($chassis.chassistypes -contains ‘9’){Write-Output “Laptop”}
elseif ($chassis.chassistypes -contains ‘10’){Write-Output “Notebook”}
elseif ($chassis.chassistypes -contains ‘11’){Write-Output “Hand Held”}
elseif ($chassis.chassistypes -contains ‘12’){Write-Output “Docking Station”}
elseif ($chassis.chassistypes -contains ‘13’){Write-Output “All in One”}
elseif ($chassis.chassistypes -contains ‘14’){Write-Output “Sub Notebook”}
elseif ($chassis.chassistypes -contains ‘15’){Write-Output “Space-Saving”}
elseif ($chassis.chassistypes -contains ‘16’){Write-Output “Lunch Box”}
elseif ($chassis.chassistypes -contains ‘17’){Write-Output “Main System Chassis”}
elseif ($chassis.chassistypes -contains ‘18’){Write-Output “Expansion Chassis”}
elseif ($chassis.chassistypes -contains ‘19’){Write-Output “Sub Chassis”}
elseif ($chassis.chassistypes -contains ‘20’){Write-Output “Bus Expansion Chassis”}
elseif ($chassis.chassistypes -contains ‘21’){Write-Output “Peripheral Chassis”}
elseif ($chassis.chassistypes -contains ‘22’){Write-Output “Storage Chassis”}
elseif ($chassis.chassistypes -contains ‘23’){Write-Output “Rack Mount Chassis”}
elseif ($chassis.chassistypes -contains ‘24’){Write-Output “Sealed-Case PC”}
else {Write-output “Unknown”}
“localhost” | check-chassis

If you want to try this out you can paste it into Powershell and see what your computer comes back with.

My computer is… a notebook. Good to know. 🙂

A sensor needs to be assigned to Smart Group to define which machines are going to be sampled. In my case, I’m going to sample all devices but you may want to gather information from a specific selection of devices and smart groups help us do that.

Now we have a Sensor and we’re sampling devices for their Chassis type what can we use it for? In part 2 we will cover how to integrate Workspace ONE Intelligence Automation with Workspace ONE UEM and how to create an Automation that uses our sensor.

Spread the love