Currently I use this to get the username of the remote system:
Get-WmiObject win32_computersystem -Computer $tag1 | Format-Table -Property @{Name="Username";Expression={$_.username}} -Autosize;
This will output:
Username
--------
GHS_NTDOMAIN\AJSTEPANIK
I want to store the AJSTEPANIK part to a variable so I can use it in another part of the script, but I am unsure how to trim it or if there is another command to get just the name.