I know this is a little late, but here are a few ways of getting the username.
Code:
BREAK ON
$Nul = SetOption("WrapAtEOL", "On")
$strComputer = @Wksta
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\cimv2")
$colItems = $objWMIService.Get(Win32_ComputerSystem)
? "UserName= " $objWMIService.InstancesOf(Win32_ComputerSystem).Item("Win32_ComputerSystem='" + $strComputer + "'").UserName
$colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem where name='" + @Wksta + "'")
? "Count=" $colItems.Count
? "UserName= " $colItems.Item("Win32_ComputerSystem='" + @Wksta + "'").UserName
? "UserName= " GetObject("winmgmts:\\" + $strComputer + "\root\cimv2").ExecQuery("Select * from Win32_ComputerSystem where name='"
+ $strComputer + "'").Item("Win32_ComputerSystem='" + $strComputer + "'").UserName
? "UserName= " GetObject("winmgmts:\\" + $strComputer + "\root\cimv2").InstancesOf(Win32_ComputerSystem).Item("Win32_ComputerSystem='"
+ $strComputer + "'").UserName
_________________________
Kelly