Maybe something smaller like this.

Code:
Break On
$sComputer='computername'
$sComputer = '\\'+Join(Split($sComputer,'\'),'',3)+'\'
$Server = ReadValue($sComputer+'HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions','ProductType')
If $Server <> "WinNT" ; System is not a Workstation so assume it is a Server
? 'System is a Server ' + $Server
Else
? 'System is a workstation ' + $Server
EndIf