New Look

If you are a regular visitor, you may have noticed that the site looks a little different.

I looked at the site during last week and decided that I had enough of the standard old blogger template. It was really boring, and half the blogger sites out there use the same template.

I spent most of Friday getting the new look ready, and I am pretty sure I have it all working now. I have added some RSS feeds and a Feedburner email subscription page.

I think the new look is cleaner and a little more unique, and I really hope you like it too. 

Your comments and suggestions are always welcome.

View Performance data in a web browser

This is a little trick, which I have been meaning to share for a while. It is a very simple way to view performance data for your server, using a web browser. Now I am sure that it’s not news to everyone, but for those of you who see this for the first time, I am sure you’ll be able to use this in your environment.

Because I work primarily with Exchange server, I will be using some Exchange performance data for this post. However, you can use any performance counters you require, according to my knowledge they all work the same way.

To setup a basic html page with some performance data, open performance monitor, and add a counter from a remote server. I my case I have selected the % Processor Time. Once the graph starts populating with data, right-click anywhere on the graph and select “Save As”. Save the html file, either to your web server, or anywhere on your disk.

If you open the file from the disk, you have to manually start the logging again, I have noticed that if the page is loaded from a web server this is not required.
Microsoft included a very nice performance template in the Exchange 2007 Toolbox. I think we’ll start there, and open a performance counter with some pre-loaded information. You can access the performance data from the Exchange Management Console. Click the Toolbox and select Performance Monitor.

You can now save this data to an html document as before. There is one catch though, the performance data saved from this console points to the local machine. You have to open the html document in a text editor, and do a find and replace on the following string VALUE=” with VALUE=”\MACHINENAME where MACHINENAME is your server name.

Now you should be able to load this html document from any computer or web server and have the selected performance data available.

Bulk export calendars from Exchange mailboxes

I have never really had the need for a script like this, so when our catering manager at the office logged a support call, requesting an export of all calendars for all of our meeting rooms, I had to investigate the possibilities. He basically needed this information in order to determine how busy the individual meeting rooms were during the last year.
Following a quick, unsuccessful, Internet probing for tools or scripts that could do this, my initial feeling was to say “No sorry, can’t be done, or if we do it, it was going to be a manual task.”

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.

I decided to attempt to script it, and the result is something I am both proud of and ashamed of at the same time, as I am convinced there must be a better way.

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 
  • Remove-MailboxPermission

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 calendar fields can be customised to suit your needs. In my case we simply needed the Start and End date, the duration, and the Organizer.

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: