A .NET Framework application receives messages from a private message queue named MyQueue.
The private queue exists on a computer named APPSERVER1.
A user in a domain named CONTOSO has the username dhall.
This user reports that when he attempts to run the application, he receives a MessageQueueException exception with the error message text
“Access to Message Queuing system is denied.”
You need to ensure that CONTOSO\dhall can receive messages from MyQueue using the .NET Framework application.
Your solution must not give dhall unnecessary privileges.
What should you do?
A.
Write the following code segment.
MessageQueue q = new MessageQueue(@”APPSERVER1\Private$\MyQueue”);
q.SetPermissions(@”contoso\dhall” ,MessageQueueAccessRights.FullControl);
B.
Write the following code segment.
MessageQueuePermissionEntry mqpe = new MessageQueuePermissionEntry( MessageQueuePermissionAccess.Receive ,@”APPSERVER1\Private$\MyQueue” , @”contoso\dhall” , null );
MessageQueuePermission p = new MessageQueuePermission(new MessageQueuePermissionEntry[] { mqpe });
p.Demand();
C.
Write the following code segment.
MessageQueuePermissionEntry mqpe = new MessageQueuePermissionEntry( MessageQueuePermissionAccess.Administer ,@”APPSERVER1\Private$\MyQueue ” , @”contoso\dhall” , null );
MessageQueuePermission p = new MessageQueuePermission(new MessageQueuePermissionEntry[] { mqpe });
p.Demand();
D.
Write the following code segment.
MessageQueue q = new MessageQueue(@”APPSERVER1\Private$\MyQueue”);q.SetPermissions(@”contoso\dhall” ,MessageQueueAccessRights.GenericRead);