Wednesday, January 20, 2016

How to get the SID of the User Account?

How to determine SID of User Account of Windows



Those who don't know what the SID is, I would like to tell you that the System ID or SID is a unique identifier assigned to each user in Windows Environment. SID is used to control access to various resources like Files, Registry Keys, network shares, etc.



Do you know your SID?

Don't you worry if you don't know the System ID of your User Account. You can determine the SID of the user through WMIC USERACCOUNT command. I am giving you syntax and example below for different method of determining SID of the user accounts of Windows.


Get SID of the Local User


wmic useraccount where name='username' get sid
For example, you have to extract SID for a local user with the login name 'SAM', the command would be as follows:


wmic useraccount where name='SAM' get sid


Get SID for Current Logged-In User

To retrieve the SID for the Current Logged-In User, below command line required to be run.


wmic useraccount where name='%username%' get sid
For obtaining the SID for the Current Logged-in User, the User Name is not required to be specified. You just need to enter %username% in the name field and the system automatically picks the User Name of the Current User which is running in the system.


Get SID for Current Logged-in Domain User

Run the command 'whoami /user' to get the SID of the Logged-in user.

get the SID for Current logged in Domain User



Get SID for the local administrator of the computer


wmic useraccount where (name='administrator' and domain='%computername%') get name,sid


Get SID for the Domain Administrator



wmic useraccount where (name='administrator' and domain='%userdomain%') get name,sid

Thank you for the Reading the Article! I hope you got the different processes of determining the SID of the User Accounts of the Windows. Please do let us know in the comments below if you are faing any problem.

Have a Nice Day!

No comments:

Post a Comment