Solved

I Need A VBscript To Export AD User Data

Posted on 2013-12-09
4
1,000 Views
Last Modified: 2013-12-10
Points of My Scenario
1. I am admin of a Windows Server 2008 R2 domain
2. I need to create monthly reports on users in Active Directory
3. The report must contain (a) username (b) Full name (c) User's OU/container (d) User's last login time (e) User's creation date

REQUEST: Please provide a VBscript that will output the data (specified in point#3) to CSV file.
0
Comment
Question by:waltforbes
  • 2
4 Comments
 
LVL 57

Expert Comment

by:Mike Kline
ID: 39707233
Does this have to be vbscript?  There are other ways such as powershell, adfind, that can make this easier than vbscript.

Even free GUI tools like adinfo   http://www.cjwdev.co.uk/Software/ADReportingTool/Info.html

I don't have a vbscript handy but can help with other methods if you are interested.

Thanks

Mike
0
 

Author Comment

by:waltforbes
ID: 39707342
Hi mkline,

I am interested in Powershell or free GUI tools. The condition is that a single query/execution must output all requested data into one CSV file. Thank you for responding so promptly.

Kind regards,
Walt
0
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 39707386
Use the following  Powershell command below to accomplish this...

Import-module activedirectory
Get-Aduser -Filter * -Properties * | Select DisplayName, sAMAccountName, 
DistinguishedName, LastLogonDate, whenCreated | Export-csv "c:\exportedUsers.csv"

Open in new window

Copy the code in notepad and save the extension to .PS1
Will.
0
 

Author Closing Comment

by:waltforbes
ID: 39708597
Hi Spec01: this solution is exactly what I needed! Kudos! Many, many thanks!
0

Featured Post

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now