Scott Salyer
Scott Salyer

Reputation: 2475

MSMQ Access Denied

I am attempting to access a queue and receiving an access denied error. The confusing part is the queue is setup to allow everyone at full control as well as anonymous and machinename$ (all three are full control - it's a test system so not a big deal). I am able to successfully write to the queue but can't Peek/Read/Receive from it. I found one article on here that suggested using the FormatName method but unfortunately I am already doing this.

The catch to this is my system is on one AD domain and the test server is running against another domain entirely (my client's). Am I trying to accomplish the impossible with this?

My platform is Vista x64 and the server is 2008 (not R2).

The code looks like this:

    Do While Not m_boolCancel

        '**Code dies on this line**
        l_ar = m_mq.BeginPeek

        'block thread till message arrived or shutdown is signalled
        If WaitHandle.WaitAny(New WaitHandle() {m_sig, l_ar.AsyncWaitHandle}) > 0 Then

            l_msg = m_mq.EndPeek(l_ar)

            If l_msg IsNot Nothing Then

                'doing stuff here

            End If

            Exit Do
        End If

Upvotes: 0

Views: 4027

Answers (4)

Henrik Vittrup
Henrik Vittrup

Reputation: 11

Check the clock between client and server: too big time span may cause an "Access denied".

Upvotes: 1

Igal Serban
Igal Serban

Reputation: 10684

Just for the test give anonymous full control.

Upvotes: 1

Joe Caffeine
Joe Caffeine

Reputation: 878

For MSMQ to work across domains the domains in question have to have a two way trust established. The message queue has to be a public queue. If you have it set as a transactional queue, both client and server must be using MSMQ 4.0 (part of windows server 2008 and later)

Upvotes: 2

olle
olle

Reputation: 4595

It shouldn't be a problem that the systems are on different domains unless you are using the domain for authentication. What happens when you give "System" full control? Please edit your question to include the code you are using to open the queue and the exact error you receive if this doesn't solve the problem.

Upvotes: 0

Related Questions