How to get active session user SID? (it is current user session)
I can do this using CMD command:
for /f "tokens=2-4" %a in ('qwinsta') do @if "%c"=="Active" wmic useraccount where name='%a' get sid
Maybe someone can tell me how to do same with VBScript?
By "current user" I mean "the account that started the script before UAC made me enter Admin credentials".
Get SID for current logged in domain user
Run the command
whoami /user
from command line to get theSID
for the logged in user.Example:
And you can do something like that with a batch file :
Give a try for this vbscript :
NB : I got it from this link How to find out logged on users SID with VBScript?