?
Solved

I Need A VBscript To Export AD User Data

Posted on 2013-12-09
4
Medium Priority
?
1,077 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
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
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

762 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