I find it extraordinarily difficult (okay… inconvenient?) to make Code Access Security Policy changes in the .NET Framework. After .NET 2.0, outside of the SDK, the graphical tools for doing this were no longer installed on most client PC’s. Usually, when I have to break out caspol.exe, it’s possibly because:

  1. I downloaded a third party DLL from a web site, and it’s not trusted, with no unblock option, and Visual Studio is complaining about it when I’m actually trying to get some real work done
  2. I want to run some .NET apps off a network share, and the machine I’m using doesn’t have .NET 3.5 SP1.

… and it’s used so infrequently that I have to look up all the command line options and re-learn the thing every time, not to mention when I finally get the command right, I’m not in Elevated Privileges mode (Vista / Win 7).

So, for those like me, who like GUIs, and just want to get an assembly or folder trusted and move on with life, I present to you – a GUI CASPOL command generator:


This supports a subset of the available CASPOL commands:

  • Single file / assembly
  • Folder path / network share
  • Different scopes (Machine / User / Enterprise)
  • Trust Level (FullTrust by default)
  • Code Groups
  • Run CASPOL command in Elevated mode

For the small executable - Download It Here (9K)

… or, here’s the source project (VS2008 / C#).


So, your Exchange 2003 server is running out of disk space, and you notice that no matter how many mailboxes you delete and purge, no matter if it’s backed up or not, no matter how short you set your deleted items retention period, you aren’t getting any disk space back… why?

To actually free up disk space, you will need to run an Exchange Database Utility called eseutil to defragment the Exchange datastore. It is located in the Exchange bin folder, usually C:Program FilesExchsrvrbin.

Also, look in your MDBDATA folder for your .edb and .stm files – you’re going to need their names. Most likely if you haven’t changed anything since installing Exchange, they are named priv1.edb and priv1.stm.

Now, before you go off to command line land, hang on a second - most likely if you’re doing this for the purpose of freeing up disk space, you don’t have enough disk space left to defragment the drive. You’ll need something, whether it’s another drive with available space or a USB stick.

Step 1: Stop the Exchange Information Store service.

Step 2: Run defragment command, and prepare to wait for a while. This is not something you do on the way out to lunch in the middle of a working day. For a 15GB database, this can take 1-2 hours.

Here’s the command:

eseutil /d “C:Program FilesExchsrvrMDBDATApriv1.edb” /f “E:TempStreamFile.stm” /t “E:TempDBFile.edb

Replace the red path to priv1.edb with your actual path to your Exchange database.

The green .stm file is the temporary Exchange Streaming File to use during defragmentation, and the blue .edb file is the temporary database to use during defragmentation. Change the paths to point to your temporary disk with enough space to hold at least the size of your original EDB.

Happy defragmenting…

As of January 1, 2010, Microsoft had to stop selling copies of Microsoft Office 2007 (in particular, Word) that uses a certain XML feature. That feature will no longer be supported, and I got a couple questions this morning on the impact of this change. Some X9 systems generate reports in Office 2007 format, and I imagine lots of other systems around the world do, too, so obviously it’s important to pay attention and check.

The feature in question is actually Custom XML Markup, and this is not a huge change in Office functionality. Unless your company uses this specific feature to integrate Word documents into other business systems, you’ll probably never notice any difference. So, let’s break this down:

Geek speak, if you please (Microsoft KB 978951): http://support.microsoft.com/default.aspx/kb/978951

This is what the feature looks like (pink representations of XML):

Selected text in an inline tag.

What versions of Office are affected?
Only Office 2007.

Once this update is applied to my system, can I still open documents created by someone else, or documents I created a while ago?
Yes. This update will not affect your ability to open or use previously created documents.

Will the .DOCX format remain the same?
Yes, according to Microsoft’s KB, the Open XML format (what you know as the .docx, .xlsx, .pptx, etc file extensions) is not affected.