A manual task, which involves, granting access to the room mailbox, logging onto the mailbox using Outlook, and exporting the calendar data to Excel. Sounds easy, but doing that a hundred times is very unproductive and torturous to say the least.
It’s a very rough method, which involves the following process:
- Get a list of rooms from a text file (as it was emailed to me). You could use get-mailbox instead.
- Add-mailbox permission to the current user
- Create an Outlook profile
- Logon to the profile
- Export the Calendar to CSV
I could automate most of the above, but creating new profiles on demand is something I’ve never had to do, and frankly, I had no idea how to get around this problem. After speaking to some of the developers at work, who promised me some dotnet code which could do it (which I am still waiting for might I add :)), I decided to use PRF files.
I have used PRF files very successfully in the past, on Terminal server deployments to automatically setup Outlook profiles. I downloaded the ORK and created a PRF which I used as a template for the script. The blank PRF is attached to this post to save you the time and effort of using ORK.
The script finds and replaces the UserName and HomeServer in the PRF, although any Exchange server should resolve you to your mailbox server. It then creates a PRF and starts Outlook with the /importPRF switch. Some extra information, for anyone wanting to actually deploy or use the PRF file; the %HomeServer% variable in the PRF does not work the same way %UserName% works, if you want use the PRF, you need to specify one of your mailbox servers instead.
While Outlook is open on that profile, the script attaches to Outlook using a COM object and downloads the calendar for the specified date.
The export data is saved and the PRF is removed, sadly the swarm of profiles will remain, and you have to manually remove them. You could remove them from HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles but I have not added that to the script.
I hope this can help you, if you ever get a freaky request like this.
The script and the PRF template can be downloaded from here:
One thought on “Bulk export calendars from Exchange mailboxes”
Thanks for sharing your insightful thoughts and suggestions – very helpful, and appreciated indeed.
On a related note, recently we needed a quick and efficient way to find out which accounts were OWA enabled (for an internal security audit) so we asked our on-site MS consultant and he recommended using the Gold Finger from Paramount Defenses Inc.
Gold Finger pleasantly surprised us because not only was it endorsed by Microsoft but also 100% FREE and loaded with almost 250 useful Active Directory security, Exchange and ACL management reports. BTW, you can download it for free from http://goldfinger.paramountdefenses.com
In particular, it has over 60 inbuilt Exchange reports, including OWA and MAPI enabled accounts. For a complete list of reports, checkout http://www.paramountdefenses.com/goldfinger_security_reports_exchange_management.php
Thought I'd share this with you incase it could help you too, especially if you need a free way to generate Exchange and AD security reports.
Thanks again, and looking forward to your next post.
Comments are closed.