18

I already wrote a code which can create a share and change permissions for the current user. The goal was to always allow all for everybody on share level and deny rights on ntfs acl level.

I use a german windows and I noticed that I only can access the everybody user by using "jeder". In english it would be the user "everybody" or "all" I think?! Anyway I'm searching for a way to get the name of the everybody user language independent.

Hope this is possible.

Mark Cidade
  • 96,194
  • 31
  • 221
  • 232
fpdragon
  • 1,815
  • 4
  • 25
  • 36

2 Answers2

33

The name that the English version of Windows uses is "Everyone".

You can get the user regardless of language by using the WellKnownSidType.WorldSid value:

var sid = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
var account = (NTAccount) sid.Translate(typeof(NTAccount)); 
Mark Cidade
  • 96,194
  • 31
  • 221
  • 232
2

I believe the way to do it has been answered here: How can I get the local group name for guests/administrators ?

This "everyone" SID is a well known SID "S-1-1-0" (the list is availalble here: Well-known security identifiers in Windows operating systems).

Community
  • 1
  • 1
Simon Mourier
  • 123,662
  • 18
  • 237
  • 283