How to get "Everyone" account name string culture indenpendantly

Hello,

I'm trying to give permissions to a message queue with this code line:

logQueue.SetPermissions("Everyone", MessageQueueAccessRights.FullControl);

This works fine on a english Windows XP, but the problem is that when I try to run this code on a portuguese Windows XP it fails because the "Everyone" account does not exist, it is called "Todos". How do I get the "Everyone" account name string culture indenpendantly I'm going to install my app in a turkish Windows XP, and I have no idea what is the name of the account.



Answer this question

How to get "Everyone" account name string culture indenpendantly

  • sebmiz

    :D

    That works!

    Thank you for your help


  • chrismoo

    This might do the trick:

    System.Security.Principal.SecurityIdentifier sid = new System.Security.Principal.SecurityIdentifier(System.Security.Principal.WellKnownSidType.WorldSid, null);

    System.Security.Principal.NTAccount acct = sid.Translate(typeof(System.Security.Principal.NTAccount)) as System.Security.Principal.NTAccount ;

    Console.WriteLine(acct.ToString());

    Good luck :-)


  • DeepaSubramanian

    The problem is that the string "Everyone" has to be hardcoded. How do I give permissions to the everyone account with knowing each language "Everyone" string
  • Tejas34

    You can use a SID, maybe through the WellKnownSidType enum. Not sure exactly how :).
  • ganeshramiyer

    Please vote the response as topic solved.


  • asifBasha

    I believe you would have to look at having localization in your app. I am unsure but I would start from here

  • How to get "Everyone" account name string culture indenpendantly