Local Logged In User

This topic contains 5 replies, has 5 voices, and was last updated by  Max Kozlov 2 years, 11 months ago.

  • Author
  • #27810

    Tim Fox

    I'm trying to come up with a way to get a display or friendly name for a local user logged into their PC.

  • #27895

    Bob McCoy

    Can you give a little more information on what you're ultimately trying to accomplish? Are you trying to create a "Hello Tim" message? Are these accounts local to the machine, or are they domain accounts?

  • #27919


    This has been working for me
    Get-WmiObject -class "win32_computersystem" -namespace "root\CimV2" -ComputerName $ComputerName | Select username

  • #27928

    Vandrey Trindade

    I'm using this for local user:


    And this for domain user:


    And I want to know what do you want to achieve too =p

  • #27931

    Bob McCoy

    And while both of those will give a user name, I wanted to know more about Tim's intention. If he's interested in local accounts, there really is no concept of a display name or friendly name in the LSA.

  • #27945

    Max Kozlov

    Local accounts have FullName or Description

    $u = [adsi]"WinNT://$env:Computername/Administrator"

You must be logged in to reply to this topic.