Locked out of your message queue?

I recently (as in this morning) did something quite silly whereby I was tightening down access to a private Windows Message Queue (MSMQ) and ended up removing myself, as well as all local and domain administrators from the message queue authenticated users.

This symptom is identified by the Computer Management console giving you the following message in the list of private queues:

{MachineName}\private$\{QueueName} - Error: Access is denied.

Even though the Computer Management console does not provide local/domain administrators access change the properties on the queue, all is not lost.

I found the solution in a stackoverflow post which I will re-iterate here:

  1. Stop the Message Queuing Service.
  2. Create a new private queue with the appropriate security settings, if one is not already available (further referred to as the Accessible Queue).
  3. Locate the properties files for both the Accessible and Inaccessible Queues, located in the folder C:\windows\system32\msmq\storage\lqs (look at the QueueName= property to identify the applicable queue property files).
  4. Copy the Security= property value from the Accessible Queue.
  5. Replace the Security= property value from the Inaccessible Queue (this should require editing the message queue properties file under Administrator privileges).
  6. Start the Message Queuing Service.

The properties of the queue should now be accessible via the Computer Management console as well.