I have updated the Exchange 2007 audit script yet again!
Included in this update are two MAJOR changes, firstly, the script uses and publishes information using the new HTML format, as created by Virtu-Al.
This script, and the functions which create its HTML output are far more efficient and literally cut the number of lines in the script down by half. Not only is the code leaner, but it is also infinitely more legible, and adding new tests to the current script is a breeze. This version of the HTML output is also compatible with multiple browsers, including Mozilla and Chrome.
Secondly, the script will now detect pipeline input. You can still use a server list as a parameter to the script, but now, you can also pipe content to the script. This content can include your server list, or output from Exchange commands such as get-transportserver or get-mailboxserver etc. Be careful though, because commands like get-exchangeserver could include Exchange 2003 servers.
If no server list is specified or piped, the script will still get all Exchange 2007 servers.
As another minor addition, I have added an additional test (Test-OutlookWebServices) to the CAS servers.
As always, your comments and feedback is always welcome.
The script can be downloaded from here:
21 comments:
Great script and I love the output ;)
Thanks Alan!
I am having problems getting this scrupt to run. all I get is the following error
Missing file specification after redirection operator.
At C:\utils\test-exchange2k7_V3.ps1:1 char:122
+ <<<<
Any ideas?
Hi Shaun,
Thanks for downloading the script. Did you pipe a server list to the script, or are you specifying a server list?
Also, when you are in the c:\utils folder, start typing the name of the script, test- and press tab.
The tab completion will have the path as .\test-exchange2k7_V3.ps1
You can then specify a server list as a parameter.
Hi,
I ran script and it's cool stuff, but output coming on multiple HTML file.
i.e we have 30 exchange 2007 servers and we are getting 30 files, is it possible in the single report all servers need to include.
Thanks
Hi Rugi,
I had a version that does exactly that, but I was working on an option, to use a parameter to specify weather or not to use the single file option. I have your email, and I will send you a script which does exactly that on Monday.
Jean
Hi.
I have specified the script as follows:
.\test-exchange2k7_V3.ps1 exchange.txt
The text file then contains a list of 4 exchange servers.
Is this the correct method?
Hi Shaun,
When you specify the text file, you can start typing the name exc.. and press TAB it will complete the name for you (C:\utils\excange.txt or .\exchange.txt)
That should work. Let me know if it doesnt.
Yeah I tried this also. This gives the same result I'm afraid
Shaun,
Could you try run the script with no text file?
I have just downloaded the file and tested it in my VM at home, and it works without problems.
Also, please send me a screen shot of the error screen to jeanlouw at gmail.
I will try to reproduce the error on my side.
Thanks for your assistance - I have emailed you the details.
Cheers
Hi Jean,
You mentioned that you were working on an option, to use a parameter to specify weather or not to use the single file option. Could I get a ciopy of that as well? I have many Exchange servers as well.
Also, to get the out emailed to me would adding this to the end of the .ps1 file work:
$smtpServer = “0.0.0.0”
$msg = new-object Net.Mail.MailMessage
$att = new-object Net.Mail.Attachment($filename)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = “exchange@domain.com”
$msg.To.Add(”you@domain.com”)
$msg.Subject = “Exchange Audit Summary”
$msg.Body = “This is an automated message from Exchange.”
$msg.Attachments.Add($att)
$smtp.Send($msg)
YB,
Thanks for your comment.
I have a script which will report into a single file. I will upload / post a copy of that script soon. It does however have a few html related problems I need to get resolved first.
If you are happy to deal with those for now, you can email me directy at jeanlouw at gmail dot com, and I will gladly send you a copy. This new script also includes some public folder information in the report.
As far as your send mail function is concerned, if you are using Powershell V2 I would suggest the following:
--------------------------------------------------
$messageParameters = @{
Subject = "Exchange 2007 Audit Report - $((Get-Date).ToShortDateString())"
Body = $fullReport
Attachments = $Filename
From = "report@domain.com"
To = "rcpt@domain.com"
SmtpServer = "1.1.1.1"
}
Send-MailMessage @messageParameters -BodyAsHtml
--------------------------------------------------
You can then have the report as the message body / or as an attachment to the message.
I hope this answers your question, and again thanks for you interest in the script!
HI Jean,
Thanks for the response and for your hard work!
I can wait for the finished product, I'm really looking forward to it!
I'll try the suggestion you mentioned for sending the email.
Thanks a bunch!
Hi Jean,
Excellent script...looks very useful.
We are running a CCR Win2008 failover cluster using mointpoints for the storage groups. At the moment the script only shows the logical disks. Is it possible to add the functionality so it also shows the mounted volumes?
Thanks.
/Steffen
Hi Jean,
When I run the script on our mailbox and cas/hub servers the result only show basic server info, installed rollups, logical disk info, exchange services and event logs. Nothing about mailbox stores, mapi connectivity etc. I have tried running it on the virtual mbx server and on the physical nodes but the results are the same. Can you guide me in the right direction on why this is happening?
With thanks in advance.
/Steffen
Hi Steffen,
Thanks for your interest in the script!
Are you running the script from the server? Does the script display any errors on the console while running?
Also, you can email me directly at jeanlouw-at-gmail-dot-com.
Using email seems a little faster when troubleshooting issues like these.
Jean
Has anyone thought of adding the top 20 mailboxes by DB???? This would allow you to identify why or whom has filled the mailstore ????
Hi Tony,
Thanks for your suggestion, and sorry for the late reply. I have recently changed jobs, and with the Easter weekend I have not had a chance to read my comments or reply.
Well, I have settled in now, and I have had some time to look at the blog, and your suggestion is great. Would you suggest this as a separate heading?
Jean
Yep i sould i've also created something sort of seperate to yours well a mini version that also displays the Active/passive server for a cluster.
Get-ClusteredMailboxServerStatus -identity $target | select-object Identity, State , OperationalMachines
Couple of other things.
1. Could you set the result size on the script to always be unlimited??? Always have to go through and change.
2. Am finding that when the new version hits the checking queues part can take upwards of an hour for one server. With the V1 version (which is what i am playing with) it takes maybe 30 seconds per cluster. My clusters have upwards of 1000 user's per SG across 4 SG's.
Tony,
Thanks for your feedback. As always it is much appreciated.
I will certainly incorporate your suggestions in the next release.
The first version of the script had a small bug with the event log, where it failed to collect all Exchange related information from the log. That version still used WMI to gather log data.
If the event log parsing is taking extremely long it could be due to a large event log on that specific server.
If possible you could try to reduce the size of the log in question?
The resultsize and the cluster services are great suggestions and I will add it to be list of enhancements.
Thanks again for your comments and suggestions.
Post a Comment
Note: Only a member of this blog may post a comment.