Skip to main content

Quick way of listing all Active Directory Domain Accounts

Listing all Active Directory Domain Accounts using WMIC

By using WMIC you can get all the AD domain accounts very quickly.

WMIC is an acronym for Windows Management Instrumentation Command-line

Here's how we do it.

Just open a command prompt, no need to be an elevated command prompt.

At C prompt type:

C:\>wmic /node:domain_name /output:d:\usr.txt "useraccount" get


Change output drive to any drive you want the output to be exported.

Note that the word "USERACCOUNT" has no space, it is  one word.

After exporting the file.

Open the text or the output file using Excel.

Open Excel, press Control+O then the open Window will show.

I'm using Excel 2010, so go to All Files and select "Text Files".

Follow the on screen instruction and click on "Finish".

Then you will be able to see all the "Domain User Accounts", "SIDs", "Description", "Lock Out Status" and other details.

Please check sample below on how the output looks like:
But of course if you open the file, in Excel it will be tabulated by rows


Sample Output Generated by the WMIC command
Account Type Caption
512 Domain_Name\Administrator
Description Disabled
Built-in account for administering the computer/domain FALSE
Domain Full Name
Domain Name Adminis traitor
Local Account Lockout
FALSE FALSE
Name Password Changeable
Administrator TRUE
Password Expires Password Required
FALSE TRUE
SID SID Type
S-1-5-21-3220555559-2567777707-111777889-500 1
Status
OK

Note: You need to have Domain Administrative privileges to run this command

Check out this link also, on how to get all AD users from command line:
http://quickbytesstuff.blogspot.sg/2015/09/display-active-directory-users-via.html


Check out this links if you want to explore more about WMIC

WMIC - Take Command-line Control over WMIC

WMIC Commands


Or click WMIC label below to find out more  WMIC tips on this blog.


Cheers!!! Hope it helps...

================================

Multiplication Table for early learners

https://play.google.com/store/apps/details?id=com.TableMultiplication


Free Android App with No Ads.

Heaven's Dew Fall
https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer


Catholic Rosary Guide  for Android:
Pray the Rosary every day, countless blessings will be showered upon your life if you recite the Rosary faithfully. 
https://play.google.com/store/apps/details?id=com.myrosaryapp


Comments