In this blog will see how to list active users with details like samaccountname, name, department, job tittle, email, etc., in Active Directory using powershell script.
A dsquery solution:
dsquery * -Filter "(&(objectCategory=person)(objectClass=user))" -Attr givenName sn displayName sAMAccountName mail proxyAddresses distinguishedName > AllUsers.txt
A PowerShell solution using the AD module cmdlet:
Get-ADUser -Filter * -Properties givenName, sn, displayName, sAMAccountName, mail, proxyAddresses, distinguishedName | ft givenName, sn, displayName, sAMAccountName, mail, proxyAddresses, distinguishedName > .\AllUsers.txt
Script for logon name, First name and Last name for all Active Directory users in a specified OU.
$params = @{ "Filter" = "*" "SearchBase" = "OU=Users,DC=fabrikam,DC=com"}Get-ADUser @params | Select-Object Surname,GivenName,SamAccountName | Export-Csv "MyOutputFile.csv" –NoTypeInformation
36 thoughts on “Powershell Script to Get List of Active Users with the Details like samaccountname, name, department, job tittle, email in Active Directory”
Terrific post however , I was wondering if you could write a litte more on this subject? I’d be very grateful if you could elaborate a little bit more. Thank you!
I’ll try to cover up in my next post
Very useful info thanx.
Thank you for your hard work.
Great blog thank you
Thank you for your hard work.
Great! Thank you so much. Keep up the good work.
Appreciating the time and effort you put. Great read!
Awesome! Its really amazing piece of writing.
Hi there! This article couldn’t be written any better!
Many thanks for sharing!
Thank you for sharing your info. I truly appreciate your
efforts and I am waiting for your further write ups thanks once again.
Good day! I simply would like to offer you a big thumbs up for your excellent info you have
right here on this post.
Keep up the great work.
Simple but very accurate info… Thank you for sharing this one.
Great post, thanks for share.
Best of luck for the next!
Pretty! This was an extremely wonderful article.
Thanks for providing this info.
Lots of people will be benefited from your writing.
Cheers!
I really appreciate your efforts and I am waiting for your further post thanks once again.
Hello there, You have done a great job.
Keep on going and keep working for yourself and others.
Good job 🙂
I really appreciate your work.
Preserve the quality of your work and good work. 🙂
You have done great job.
very interesting topic, outstanding post.
Thank you for the good writeup.
Hey very interesting blog!
Very nice article, exactly what I wanted to find.
You’re wonderful! Thanks!
I’m impreѕsed, I have to admit. Seldom dο I encounter a blog
that’s both equally educative and engaging, and let me tell you, you’ve һit the naіl on the head.
Find It truly useful & it helped me out a lot. I hope to give something back and help others like you aided me.
I’ve read a few excellent stuff here. Definitely worth bookmarking for revisiting.
I wonder how much effort you set to create this type of wonderful informative site.
I want to say that this article is awesome.
I would like to peer extra posts like this .
I truly prize your work, Great post.
Hi there i am kavin, its my first time to commenting anyplace,
when i read this piece of writing i thought i could also create comment due to
this sensible article.
It’s an amazing article for all the internet people; they will get benefit from it I am sure.
Your web site doesn’t show up appropriately on my apple iphone – you may want to try and repair that
Made some changes and plugins updated, hope you like it..