$GetWMIObject = Get-WMIObject Win32_ComputerSystem -Computername "NomOrdinateur" $UserName = $GetWMIObject.UserName write-host $UserName