
In this case, it's the Exchange-specific version. I generally configure it as a Scheduled Task triggered by the OnBoot event (with a fire-delay for Win2012R2+). The script logs a transcripted file & emails an html-format report, covering the following tests & status:
- Runs an automatic pause/delay when run on sub Win2012R2 OS's (to permit time for services to startup and come online naturally).
- Locates a suitable local HubTransport role box to handle smtp report submissions.
- Collects & reports on the state of key Exchange (2010) services by role.
- If it finds a key service in a non-Running state, it then makes up to 20 attempts (configurable) to start each failed service.
- In the case where it does attempt a service manual start, it then re-confirms post-status on the services.
- It then runs a stock Test-ServiceHealth (redundant with the above, but more descriptive of role-specific status, with it's handy divided status layout).
- For mailbox servers it then:
- Runs & reports on Test-ReplicationHealth
- Runs & reports on Get-MailboxDatabaseCopyStatus
- Collects a list of all suitable hubtransport servers and checks for mail queued to maildatabase's: In my case, they're named in a matchable pattern, so I just go after the names.
It's also a simple prospect to collect them via something like...
get-exchangeserver |?{$_.istransportserver -and $_.site -eq 'Sitename'}
...as well. - Runs & reports on a pass of Test-MAPIConnectivity against a random mailbox in each database in the DAG.
- And for Transport servers, it runs & reports on the status of all queues (get-queue) on the box.
Also, I probably should add a block for CAS server reboots, to report on user-utilization levels for the various CAS IIS AppPool's etc. But that's something for another day. :^D
This is a 900+line script, so I'm not going bore you displaying the full source.:P But here's a Gist with the data-gathering bits demo'd...
The full code & current revision can always be found at Github: check-ExchSvcStatusRpt.ps1
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.