23

The person who was previously using my PC at work set up a private MSMQ that I need to access. They have since left the bank but the permissions remain and I can't access the queue or give myself edit permission to remove the restriction.

I am an admin on this machine now so I'm assuming there's some way for me to change things..Been searching high and low but most of what I find is related to doing things through scripts.

Any help appreciated,

thanks

Alex
  • 2,681
  • 3
  • 28
  • 43

4 Answers4

41

And for a manual process if all else fails:

  1. Stop the MSMQ Service (Services -> Message Queuing)
  2. Open the C:\WINDOWS\system32\msmq\storage\lqs folder
  3. Find the config file in this folder that describes a queue that has "good" security permissions. You will need to open each file in turn with a text editor to determine which queue it relates to.
  4. Once you have the correct file open, locate the line in the file that begins Security=....
  5. Copy the whole line to your clipboard (watch out for Word Wrap, this line will be quite long)
  6. Find the config file in this folder that describes your problem queue
  7. Open this file in a text editor.
  8. Overwrite the Security=... line in this file with the contents of your clipboard
  9. Save the modified file
  10. Start the MSMQ service; new permissions will be picked up.

Cheers

John Breakwell

John Breakwell
  • 4,667
  • 20
  • 25
  • 1
    I saw this solution elsewhere, but my ...\lqs folder just has a bunch of files with long digit names and digit/letter extensions and I didn't want to start messing with things I didn't understand. Perhaps something on my PC is configured differently so I can't use this method? – Alex Jan 05 '11 at 13:27
  • 1
    The file names are the way they are for quick lookups by MSMQ. You just need to find the text file that contains the name of the queue you want. (See http://support.microsoft.com/kb/174307) – John Breakwell Jan 28 '11 at 03:00
  • 4
    If you have not any queue that has "good" security permissions, then just create a new queue with required security permissions. And follow @JohnBreakwell Breakwell's steps with this new queue. Note: Do not forget delete that your new dummy queue when you finish. :) – Uğur Aldanmaz Aug 05 '14 at 09:48
  • 2
    Hello, John from 2011! I am from more than eight years into the future, and would just like you to know that at this point, you are stille helping people! Thank you so much! – Kristoffer Lerbæk Pedersen Jan 28 '19 at 09:13
  • I was I wasn't upvoting this answer 10 years after it was first provided. – PSGuy Jan 13 '21 at 22:14
22

Right click on Your Queue -> Properties -> Security -> Goto Advanced and modify permission for groups.

ashish.chotalia
  • 3,696
  • 27
  • 28
  • 7
    I couldn't Apply anything so I didn't think to go to Advanced settings! Turns out I just had to grab ownership of the queue, thanks! – Alex Jan 05 '11 at 12:18
  • 2
    Whenever I tried to apply any of the changes I'd made it would say I didn't have permission to make the changes, that's all. Changing the ownership over to me solved the issue. – Alex Jan 05 '11 at 13:29
8

First, change the ownership of the queue to the Administrators group; then assign yourself the permissions you need.

Steve Mitcham
  • 5,268
  • 1
  • 28
  • 56
user4475618
  • 127
  • 1
  • 1
  • I don't get why this answer is getting downvoted. Based on the op's comments to the accepted answer, this is basically what he did to resolve his problem. – Elezar Jan 25 '17 at 23:08
  • @Elezar It is four years late, and does add nothing over the existing answers from four years ago. – Alexander Jan 27 '17 at 07:57
  • I don't get how it's "late" considering the steps listed are still completely relevant. And it does add something over the answers, in that it specifies changing the ownership. Neither of the other answers mentioned that. The accepted answer won't work in most cases if you're not the owner (and in fact, as mentioned by the OP in a comment, he **did** have to change ownership first to get that answer to work), and this could be simpler than the manual method provided by John Breakwell, for people that are able to change ownership. – Elezar Jan 27 '17 at 20:19
  • My post was a 'last resort' method. – John Breakwell Nov 05 '17 at 02:18
2

The easiest approach to allow modifying permissions from the user which didn't allow do this is to run PowerShell as Administrator and run the command:

Get-MsmqQueue -Name "MyQueue" -QueueType Private | 
  Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl

This will allow you to edit permissions in the Windows user interface.

Orest Gulman
  • 422
  • 1
  • 8
  • 25