Created
February 23, 2018 18:07
-
-
Save bohack/621bebce58318778a5ba07e845b4e7ef to your computer and use it in GitHub Desktop.
Get a list of users by their SAMid and lookup their UPN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM Bohack | |
REM 2/23/18 | |
REM Get a list of users by their SAMid and lookup their UPN | |
FOR /F "TOKENS=*" %%a IN (listofusers.txt) DO ( | |
ECHO %%a | |
DSQUERY USER -SAMID %%a | DSGET USER -SAMID -UPN | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment