I’m building an automated remediation and would like to include the Asset Form Factor value in an email being sent out. However, {{asset_type}} returns “Syncro Device” and not “laptop” or “desktop” as I had hoped. Does anybody know what the tag for this field is off the top of their head?
I don’t see a tag for that field unfortunately. One of Syncro’s many inconsistencies.
Might try checking for the presence of a battery. Desktops generally don’t have one. I use this function when puling monthly battery health reports.
Function HasBattery(){
$BatteryTrueOrFalse = Get-WmiObject -Class win32_battery
if ($BatteryTrueOrFalse) {
return $true
}
Else {
return $false
}
return $false
}
#don't run if there is no battery to test
if(HasBattery){Write-host "Laptop Detected"}else{Write-host "Desktop Detected"; exit 0}
In general you’re correct, but if you have battery backup UPS’s with the usb port plugged in, they show up as batteries to Windows so they can automatically shutdown the system when it gets low. Something like this should be more reliable but I haven’t tested: PowerShell Gallery | functions/Get-ChassisType.ps1 1.5.8
Use Get-ComputerInfo. It will return all kinds of info, including Form Factor. You can then populate an asset custom field if needed.