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

VBScript: Distribution List Audit

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
itsmevic
Asked:
itsmevic
1 Solution
 
Malli BoppeCommented:
I Have used the attached script to dump information about the all groups in the domain.
All-Groups-with-GroupMembers.vbs
0
 
Meir RivkinFull stack Software EngineerCommented:
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

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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