Monday, May 16, 2022

Display Logged on User Account SID

 

Simple Command Line to Display Logged on SID

A simple method to display the SID of the logged in user domain user account is using a command that's common but not often used. It's been part of the MS Windows operating systems since before Windows 10 and present in server additions as well.    

The whoami command when run without options will display the currently logged in user account If you are providing remote support, this command is helpful if you are remotely accessing the desktop and troubleshooting an issue that requires knowing the user's SID such as user profile issues.  

If your not familiar with the whoami command at all try it out. On a desktop logged in with a Domain account, open a command prompt and then type the command whoami and hit the enter key. The command's output displays just the currently logged in user. 

Run the command again (up arrow) and add the simple option  /user  and it will display the SID of the user like this: 

           C:\>whoami /user 




Display local SID of non-domain user account 

If the user is not a domain account, like a desktop at a remote office or home display the local windows account SID use the following command line 
      
                     wmic useraccount where name='username' get sid

 


  


  

Share/Save/Bookmark


Working on user profiles or other user account issues on for Windows or other operating system platforms with the help of online desktop control. Enhance your Support Service level with Software for Desktop Support Online.  Take on small desktop application issues or the more affecting server problems. Even if you have a remote access software, add an affordable backup and alternative of Online Remote Support Software to remotely access desktops online and provide support.  No agent or preinstalled software required. No plugins or browser extensions for remote desktop screen sharing sessions using 4RemoteSupport. Their service offers No cost increase ever and an unlimited number of sessions. Try for Free. 




   

4 comments:

Microsoft Support MVP said...

I've used the whoami command line command way back on old windows operating systems. Haven't used it too often in recent versions . The reason is that the start button on newer windows system display the logged on user account. I didn't know about the option to display the SID . Now that I do, I have new use for the command. Also, its ver much more easy to remember than the wmi command .

Microsoft Support MVP said...

Great new use for the whoami command. That command is not only available on Linux and Unix but it also been in every windows operating system. The command you presented to display the SID of the currently logged in use is the absolute simplest method. I now have a new use for that command. Used to use it to display the logged in user name . Often work on user profile problems to it will be useful for those situations.

Microsoft Support MVP said...

Useful command when working with and supporting user profiles on Microsoft Windows desktops and terminal servers like Microsoft RDS.

Microsoft MVP Support said...

A new found use for the forgotten or seldom used command. it's a short and easy to remember command that is now useful to me when working with local and even Microsoft domain user profiles. Strat thinking how many other commands are still viable and usable that have been long lost. Of course PowerShell is more the push for command line problem solving that the CMD prompt in Windows.
PowerShell can provide the local user account name from a SID.
So using PowerShell Get-LocalUser will show the user account like this:

Get-LocalUser -SID S-1-5-21-9526073513-1762370368-8657243776-500

Name Enabled Description
---- ------- -----------
Administrator True Built-in account for administering the computer/domain