$arrUserNames = WMIQuery('UserName','Win32_ComputerSystem',$ComputerName)
If Not @ERROR
$username=$arrUserNames[0]
EndIf
_________________________
How to ask questions the smart way <-----------> Before you ask