Powershell function to generate a HTML report from the Exchange 2010 admin audit logs


This a small function I wrote  in powershell that generates an easier to read HTML report from the Exchange Admin Logs using the Search-AdminAuditLog cmdlet. You must run it from the Exchange Management Shell to see the Cmdlet Name and Cmdlet Parameters correctly.

function Exchange_Audit_Logs_Report {

<#
.SYNOPSIS
Generates a html report from Search-AdminAuditLog cmdlet.

.DESCRIPTION
This function generates a html report from the Exchange Admin Audit Logs.
For the function to work correctly must run it from the Exchange Management Shell.
The funcion can search for specific user generated events or cmdlets in a specific
interval as well as search for all users/cmdlets except the ones you specify.

.PARAMETER StartDate
The function will lookup events starting from this date

.PARAMETER EndDate
The function will lookup events until this date

.PARAMETER Cmdlets
The report will include only the cmdlets you specify here (comma separated)

.PARAMETER Users
The report will include only the users you specify here (comma separated)

.PARAMETER IgnoredCmdlets
The function will include all cmdlets except the ones you specify here (comma separated)

.PARAMETER IgnoredUsers
The function will include all users except the ones you specify here (comma separated)

.PARAMETER ExportPath
Location where to save the report

.EXAMPLE
Exchange_Audit_Logs_Report -startdate 01/15/2012 -users myuser1,myuser2 -cmdlets new-mailbox,enable-mailbox

Description
———–
Generates a html report for all new-mailbox and enable-mailbox commands
ran by myuser1 and myuser2 from 01/15/2012 until current day.

.EXAMPLE
Exchange_Audit_Logs_Report -startdate 01/15/2012 -ignoredusers myuser1,myuser2 -ignoredcmdlets new-mailbox,enable-mailbox

Description
———–
Generates a html report for all cmdlets and users from 01/15/2012 until
current day except for the events generated by myuser1 and myuser2 and
except new-mailbox and enable-mailbox cmdlets.

……………………..

Click here to download the script: ExchangeAdminAuditLog.ps1 

 

 




Tags: , , , , ,

Daca vrei sa vezi ce-i mai trece prin cap suricatei in continuarea, aboneaza-te la RSS.

Information and Links

Other Posts

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Hi, great script, only problem is when I run it nothing happens – no error or report file. Am I missing a simple step somewhere.

I found my problem – You need to call the function at the end of the script.

This is a very good Exchange Audit script.

Thanks so much it’s great!!

It’s a pity you don’t have a donate button! I’d definitely donate to this fantastic blog! I suppose for now i’ll settle for bookmarking and adding your
RSS feed to my Google account. I look forward to brand new updates and will talk about this website with my Facebook group.
Chat soon!