This is another script that's similar to the last few that I've posted in that its designed to query all the mailboxes on a given server and then report the information it finds. The way this script differs is that firstly its a powershell script and secondly it creates a little Winform gui to allow you to interact with the results of the query so its no longer just a static report. The layout it reports back in is two Listviews the first list view shows a summary of the number of appointments the WebDAV query finds for each mailbox and the second is activated when you click a row in the first list view which then shows a list of the appointments in the calendar of the mailbox selected. To make this a little more useful I've added a bunch of filtering options across the top so you can take the original data captured in the appointment query and filter it in a few different ways. Eg you can filter it by the last modified date so you could answer a question such as
Show me all the appointments that where modified after a certain date Or
Show me all the appointments that where modified before a certain date
The two other filtering options are for Free/Busy so you can show all the appointments that are set to free in the time period or all the appointments that aren't set to free. the last filter option is for the Time Zone Mapi property that Matt Stehle blogged about the other day this should show you all the appointments that the rebasing tool has been run on and any that it hasn't. You can combine multiple filters so you could show the number of appointments that where modified after a certain date by the rebasing tool etc.
The Script uses WebDAV via the Admin virtual root directory to access the user calendars this gets around the need for the user running the script to have rights in the users mailbox and should be able to be run successfully using just delegated Exchange Admin rights. To work out the correct path to use for the Admin virtual root the script includes a LDAP query that gets the default SMTP FQDN from the default recipient policy.
By default the script isn’t using SSL which may mean you need to adjust the following line if you are using SSL on the ExAdmin Directory
Eg change line 162
$arMbRoot = "http://" + $snServerNameDrop.SelectedItem.ToString() + "/exadmin/admin/" + $dfAddress + "/mbx/"
$arMbRoot = "https://" + $snServerNameDrop.SelectedItem.ToString() + "/exadmin/admin/" + $dfAddress + "/mbx/"
The script works by querying appointments and then filling a datatable the filtering options work by filtering the data in the datatable using Table selects built by examining the state of different controls and repopulating that data in the listviews I've taken the complete automation approach with this script so there are no command line parameters or servername variables to fill out. When the script runs it will populate the servername list box with the name of all the Exchange servers it finds by querying the configuration partition of the domain its being run in. When you use the script itself you only need to hit the get-appointment button once. After you hit the button in the background the script will attempt to get the appointments for the server you select this can be a lengthy operation to give some progress the script writes back to the console windows as it processes each mailbox. So you may want to push the form to one side and what the status of the powershell console window as it processes each mailbox. When you want to re-filter the data using the filtering options make sure you hit the filter button to filter the data and not the get-appointment buttons. The filter button will re-filter the data in a matter of seconds while the get-appointments but will re-query all the appointments which will take a considerable amount of time. If you want to query other times outside of the DST affected ones you can with this script using the datetime pickers for start and end time..
I've put a downloadable copy of the script here the script itself blew out to over 500 lines so its a little two large to post.