Shadow_Walker Posted June 16, 2017 Posted June 16, 2017 Anyone got a way to export users from AD to a csv file. I only need the username, first name and last name. I have come across a couple of powershell scripts but wanted to see if anyone here would recommend anything.
Shadow_Walker Posted June 16, 2017 Author Posted June 16, 2017 Already tried that it just exports the username and year group. Need the first name and surname as well.
djm968 Posted June 16, 2017 Posted June 16, 2017 Click View - Add/Remove Columns, Select the Columns you need then Export the list as a CSV file. 1
caffrey Posted June 16, 2017 Posted June 16, 2017 dsquery ? dsquery user "your distinguishedname" -l 0 | dsget user -samid -fn -ln > csv.txt To get the ldap path just right click on an OU and select the Attribute editor, DistinguishedName
adhutton Posted June 16, 2017 Posted June 16, 2017 We use this: Bulk AD Users Works very well. Andrew
ADMaster Posted June 16, 2017 Posted June 16, 2017 +1 for bulk AD, should be easy enough with powershell too.
djm968 Posted June 16, 2017 Posted June 16, 2017 Hammer to crack a nut IMHO, I use PowerShell for many things but why reinvent the wheel when MS built-in the option to export directly from ADUC.
Shadow_Walker Posted June 16, 2017 Author Posted June 16, 2017 Click View - Add/Remove Columns, Select the Columns you need then Export the list as a CSV file. Completely forgot about that thank you - - - Updated - - - Thanks all for the comments all sorted.
ADMaster Posted June 16, 2017 Posted June 16, 2017 Hammer to crack a nut IMHO, I use PowerShell for many things but why reinvent the wheel when MS built-in the option to export directly from ADUC. In this case yes, but IIRC you cannot add every field to those columns. (not in front of my PC to check) Also if you want to pull an export from multiple OUs.
psydii Posted June 16, 2017 Posted June 16, 2017 I really recommend forcing yourself to use powershell for this sort of thing. The more you use it the better at it you get. The better at it you get, the more easily you can do clever things. get-aduser -Properties givenname, sn -searchbase "OU=Staff,DC=School,DC=district,DC=sch,DC=uk" |select givenname, sn, userprincipalname|export-csv -path users.csv
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now