I need to acquire following information from the Windows 2008 Active Directory Domain Controller Server.

a) User name    
b) User ID  / O.U  
c) User Status (Disabled/Enabled)    
d) User Creation Date    
e) User Deletion Date    
f) User Last Login Date

I can get the user list by following command 

dsquery user -limit 0 | dsget user -dn -disabled -display -email -dept -title

How can I get other information as well in single window or text file?

  • Never mind, I got it using following command. Feb 8, 2017 at 6:11

1 Answer 1


I was able to acquire my customized result. I mostly use my Ubuntu box to manage my Active Directory. Following is full command from Linux terminal to acquire active directory user details for required query.

winexe -U DOMAIN/ADMIN%"PASSWORD" // 'powershell.exe -command "import-module activedirectory; Get-ADUser -Filter * -Properties * | select Name,UserPrincipalName,Enabled,LockedOut,Created,LastLogonDate"' > /tmp/ad-users-details.txt

I used semicolon to execute two commands in single line, it was required to import AD modules first

I then tag it with webmin base modules, and all Ok now for support staff as well.




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.