Active Directory Commands

This is a list of commands I have used to fulfill specific Active Directory related tasks. This page will be updated as I learn so feel free to bookmark it as a reference.

How do I get a list of all domain controllers in an Active Directory (AD) Domain?

On a command prompt or Powershell run the following, substituting domain.net with the domain you want to query:

nltest /dclist:domain.net

How do I see the Windows username of the currently logged-in user?

Type the following on the command prompt:

whoami