Ok, been playing and got this to work:

Have to change your wmi query to this (take off the parms):

$colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

Then do this:

$hostname = "SHAWN"

?"UserName=" $colItems.Item("Win32_ComputerSystem='$HOSTNAME'").UserName