
To get a list of all user accounts in a domain and export them into a text file, run the following command (you need to have the appropriate permissions to run this command, a domain admin will work):
net user /domain > domain-user-list.txt
This will export a list of all domain users to a text file in the working directory. This should work in any Microsoft Windows Active Directory Domain.