The solution posted here seems a bit of a hack. Perhaps this is necessary for Windows XP. I've encountered something similar using Windows 7 and used a different approach to solve this.
Situation:
- Program consists of C# code that creates a private transactional queue
- Program is run as a windows service, running on the Local System account.
- When the service is run, the private queue is created with the Local System account as the owner.
- Even though I am administrator, I can't inspect the messages from the queue.
Solution (this is for Windows 7):
- Run compmgmt.msc
- Open 'Services and Applications'
- Open 'Message Queues'
- Open 'Private Queues'
- Right-click the newly created queue
- Click 'Properties'
- Select the 'Security' tab
- Click 'Advanced'
- Select the 'Owner' tab
- Select 'Administrator'
- Select 'Permissions' tab
- Click 'Add'
- Type in the name of you account (e.g. 'Administrator')
- Click 'Check names'
- Click 'OK'
- Click 'OK'
- Click 'OK'
Now you can access the messages in the queue and also purge the queue if you would like to.