Hi All
I am using this line in a batch script which successfully stores a user's SID value into a variable called SID
I'd like to modify this to include an "AND" in the WMI Query but I can't seem to get it to work.
The correct query is:
Can someone please help me translate this so the SID value is stored into a variable?
Thanks!!!!!
I am using this line in a batch script which successfully stores a user's SID value into a variable called SID
Code:
FOR /F "tokens=1,2 delims==" %%s IN ('wmic path win32_useraccount where name^='%_curruser%' get sid /value ^| find /i "SID"') DO SET SID=%%t
The correct query is:
Code:
wmic path win32_useraccount where "name='%USERNAME%' and Domain like 'HB%'" GET SID /VALUE
Thanks!!!!!