user38309
user38309

Reputation: 2258

Localized group name

I want to configure a Mutex access rule by assigning privileges to the "Everyone" group. When I create my rule it looks something like the following

new MutexAccessRule("Everyone", MutexRights.Modify | MutexRights.Synchronize | MutexRights.TakeOwnership | MutexRights.ReadPermissions, AccessControlType.Allow)

How do I get the localized "Everyone" group name so this will work on a non english version of the OS.

Thanks

Upvotes: 14

Views: 3035

Answers (1)

Richard
Richard

Reputation: 109130

Rather than using the group name, use the underlying SID, which is not localised.

var rule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null),
                               MutexRights.Modify
                                | MutexRights.Synchronize 
                                | MutexRights.TakeOwnership
                                | MutexRights.ReadPermissions,
                               AccessControlType.Allow)

Upvotes: 18

Related Questions