Solved

VBScript:  Distribution List Audit

Posted on 2013-05-20
2
662 Views
Last Modified: 2013-06-11
Curious if anyone has in their script repository a script that will query AD and audit  and report (.csv file ) on any new Distribution List that were created during a set period of time.  In my case, the prior week.  The report would need to include:

- Distribution List Created
- Members Count, information for that Distribution List.

and any other helpful info you could throw in.  : )

Thanks a million in advance!
0
Comment
Question by:itsmevic
2 Comments
 
LVL 23

Expert Comment

by:Malli Boppe
ID: 39183527
I Have used the attached script to dump information about the all groups in the domain.
All-Groups-with-GroupMembers.vbs
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39183652
you can have task scheduler which runs script once a week and output all new Distribution List Created, Members Count and information for that Distribution List:
here's a powersehll script which do the job:
cls
$week = (Get-Date).AddDays(-7)
Get-ADGroup -filter {GroupCategory -eq "Distribution"} -properties whencreated | 
where { $_.whenCreated -ge $week } | 
select-object Name,whenCreated,DistinguishedName, @{Name="Members Count";Expression={@(Get-ADGroupMember $_).Count}} | Export-Csv c:\temp\1.csv -NoTypeInformation

Open in new window


to run it once a week, run the following command:
SCHTASKS /Create /SC weekly /TN DistributionListAudit /ST 00:00 /TR "powersehll c:\scripts.DistributionListAudit.ps1"

Open in new window

change the script name and location to the place u saved the script.
0

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

18 Experts available now in Live!

Get 1:1 Help Now