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