Thursday, April 14, 2011

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

From stackoverflow
  • 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)
    

0 comments:

Post a Comment