No permission to access a private MSMQ

后端 未结 2 1031
故里飘歌
故里飘歌 2021-02-01 04:43

On an XP machine there is a private messagequeue that was created by a .net service. When I want to access this private queue in a VB6 application I keep getting an \"Access is

2条回答
  •  萌比男神i
    2021-02-01 05:11

    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):

    1. Run compmgmt.msc
    2. Open 'Services and Applications'
    3. Open 'Message Queues'
    4. Open 'Private Queues'
    5. Right-click the newly created queue
    6. Click 'Properties'
    7. Select the 'Security' tab
    8. Click 'Advanced'
    9. Select the 'Owner' tab
    10. Select 'Administrator'
    11. Select 'Permissions' tab
    12. Click 'Add'
    13. Type in the name of you account (e.g. 'Administrator')
    14. Click 'Check names'
    15. Click 'OK'
    16. Click 'OK'
    17. Click 'OK'

    Now you can access the messages in the queue and also purge the queue if you would like to.

提交回复
热议问题