1

I'm using named pipe for a communication inside a C# process. The software is used on different Windows PCs. On some PCs my software is working and on some I get the following error:

"Some or all identity references could not be translated."

I can't find any log entry in the Windows Event Log nor in the Windows Firewall log.

Thats the code I'm using:

PipeSecurity pipeSecurity = new PipeSecurity();
pipeSecurity.AddAccessRule(new PipeAccessRule("Users", PipeAccessRights.ReadWrite | PipeAccessRights.CreateNewInstance, AccessControlType.Allow));
0

1 Answer 1

3

The error "Some or all identity references could not be translated." means that one those machines your group name "Users" did not exist. These groups might have a different name on different machines, e.g. on machines with a non-english OS language.

Try using security identifiers (sid) instead:

var sid = new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null);
var usersAccount = sid.Translate(typeof(NTAccount));
pipeSecurity.AddAccessRule(new PipeAccessRule(usersAccount, ...
2
  • 1
    The Users group was missing. Using an English system everything is fine. Using a non English system we have the error.
    – Michael
    Commented Jun 15 at 9:27
  • Seems you could pass the sid object directly, as its base class is IdentityReference Commented Jun 16 at 1:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.