Get information about users AD-groups

The below batch-code (.bat) will ask you for an AD-user name. It will then run the command net user for the entered user. Paste the result to a temporary text file and open that text file in Notepad for you to view and search through.

NB! It is also possible to use the command gpresult, if the command net user doesn’t work for you.

@echo off
set /p uname="Enter username: "

net user /domain %uname% > C:\temp\useroutput.txt
REM gpresult /user %uname% /R > C:\temp\useroutput.txt
notepad C:\temp\useroutput.txt

 

Leave a Reply

Your email address will not be published. Required fields are marked *