I am trying to interface a Web Service Client with a Server program where
communication is achieved via Named Pipes.ÃÂ My difficulty is that the
Web Service runs under the "NETWORK SERVICE" system account and the Server
runs under another local account with administrator privilege.ÃÂ I am trying
to introduce code in the server that grants write access to the pipe to the
"NETWORK SERVICE" account.ÃÂ I assumed that the following would work:
PipeSecurity pipesec = pipeServer.GetAccessControl();
ÃÂ ÃÂ ÃÂ new PipeAccessRule(@"NT AUTHORITY\NETWORK SERVICE",
ÃÂ ÃÂ ÃÂ PipeAccessRights.Write,
ÃÂ ÃÂ ÃÂ AccessControlType.Allow));
Unfortunately in this sequence, the call to SetAccessControl produces the
an exception (see below).ÃÂ I have verified that the routines GetAccessControl
and SetAccessControl can successfully be called in sequence, but, of course,
this is of little utility without the intervening AddAccessRule.
Here is a listing of the sample program.