Hi,
I’m trying to use this to change the output of the line below from Computername\Username, to simply Username
Get-wmiobject win32_computersystem | select username
When I use the code below, the output is @{username=\Username}
$User= get-wmiobject win32_computersystem -computer $ComputerName2.text | select username
$ID= $User-replace “Computername”, “”
Where am I going wrong on this one?
Thanks