WCF binding net.pipe does not work when the server is running without promotion. This blog helped me find the answer - http://weblogs.thinktecture.com/cweyer/2007/12/dealing-with-os-privilege-issues-in-wcf-named-pipes-scenarios.html
So, I added the SeCreateGlobalPrivilege privilege to the corresponding non-admin user, but now I need to enable this privilege programmatically in .NET
Now there are several examples on the Internet of how to do this in .NET, but they all essentially rewrite simple C code in C # with P / Invoke.
I want to know how to do this using special .NET types such as ObjectSecurity, Privilege, etc., so that my code does not do P / Invoke - let the system code do it for me.
Is it possible?
Thank.
EDIT1
What makes me think it's possible? Well, I searched for using the AdjustTokenPrivileges P / Inovke API in .NET using Reflector and found that there is an ObjectSecurity.Persist method that ultimately calls this P / Invoke. Then this ObjectSecurity has one protected constructor, which means that non-MS code can be obtained from it and call this method.
Thus, this seems feasible using .NET type code (i.e. no reflection).
source
share