A Quick Way to Access Users' Security Information

By accessing the environment variables in a user's logon session, you can quickly retrieve the user's security information.

Jan De Clercq

May 13, 2014

1 Min Read
Windows Gatekeeper QA
Windows Gatekeeper Q&A

Q: When troubleshooting problems, Windows administrators often need quick access to user security information such as the user's logon name, logon domain, and authenticating domain controller (DC). We can't always rely on the user for providing this information, so what's the easiest way to find it?

A: A very easy way to retrieve a user's security information on a Windows system is to check the content of the environment variables that are available in the user's logon session. For example, to find out the authenticating DC, open a command prompt window and type:

Set l

This command will display all the environment variables starting with the letter l. The user's authenticating DC is listed on the LOGONSERVER= line. Similarly, to find out the user's logon name and logon domain, type the following command at the command prompt:

Set u

This command will display all the variables starting with the letter u. The user's logon name is listed on the USERNAME= line. The user's logon domain is listed on both the USERDNSDOMAIN= and USERDOMAIN= lines.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like