Solved

I Need A VBscript To Export AD User Data

Posted on 2013-12-09
4
1,046 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 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
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 …

688 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