Now this is tip is to find the user account when you have a SID. Get SID for the domain administrator wmic useraccount where (name='administrator' and domain='%userdomain%') get name,sid Get SID for the local administrator of the computer wmic useraccount where (name='administrator' and domain='%computername%') get name,sid Run the command ‘whoami /user’ from command line to get the SID for the logged in user. Get SID for current logged in domain user wmic useraccount where name='%username%' get sid This can be used in batch files which may be executed from different user accounts. This does not require you to specify the user name in the command. To retrieve the SID for current logged in user we can run the below command. Wmic useraccount where name='John' get sid
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |