we will write a script to determine if a computer is a laptop or a desktop from a hardware prospective and display the output on the console. If this requires admin rights, you should detect if it is running as an admin or standard user. Extra points for writing a simple function that returns a boolean.

You can checkout this MSDN article for more information. on the Win32_ComputerSystem class which contained a PCSystemType property. You could also search through the WMI classes using Get-WMIObject -List *computer*.

Based on that MSDN article, only a value of 2 is a mobile computer (laptop). Based on some of the comments listed on the scenario requirements for this event, it appears to be safe to assume that all others are considered to be desktops.

I am using a workstation so below command security status should return 3

 Get-WmiObject win32_systemenclosure 
Manufacturer   : Dell Inc.
Model          : 
LockPresent    : False
SerialNumber   : ------
SMBIOSAssetTag : 
SecurityStatus : 3
 

So Below is the script to identify the Type of system

function Get-ComputerType{

Get-WmiObject win32_systemenclosure | ForEach-Object {
if ($_.ChassisTypes -eq 3){
Write-Host -ForegroundColor Green 'This is Workstation'
}
else{
Write-Host -ForegroundColor Cyan 'This is a Notebook'
}}}