Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I Need A VBscript To Export AD User Data

Posted on 2013-12-09
4
Medium Priority
?
1,102 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

636 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