• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1123
  • Last Modified:

I Need A VBscript To Export AD User Data

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
waltforbes
Asked:
waltforbes
  • 2
1 Solution
 
Mike KlineCommented:
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
 
waltforbesAuthor Commented:
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
 
Will SzymkowskiSenior Solution ArchitectCommented:
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
 
waltforbesAuthor Commented:
Hi Spec01: this solution is exactly what I needed! Kudos! Many, many thanks!
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now