Although Mike's answer is correct, he assumes that the server has English. If you use this code on a server that uses a different language (in this case, Dutch) ...
queue.SetPermissions( "Everyone", MessageQueueAccessRights.FullControl, AccessControlEntryType.Allow);
... you get the following exception:
Kan de naam Everyone niet omzetten (fout = 1332). System.Messaging.AccessControlList.MakeAcl (IntPtr oldAcl) bij System.Messaging.MessageQueue.SetPermissions (AccessControlList dacl) bij System.Messaging.MessageQueue.SetPermissions (String User, MessageQueueAccessRights, AccessControlEntryType
which roughly translates to “Cannot convert the name to“ Everything. ”Instead, if you use this code, you will get a localized version of“ Everyone ”:
using System.Security.Principal; ** code ommitted** string everyone = new SecurityIdentifier(WellKnownSidType.WorldSid, null).Translate(typeof(NTAccount)).Value; queue.SetPermissions( everyone, MessageQueueAccessRights.FullControl, AccessControlEntryType.Allow);
source share