Server 2008 cannot set user rights

I tried to do some Win32 stuff in C # 3.5 to get elevated user rights for a console application. I am developing Visual Studio 2008 SP1 / GDR and everything works fine when it starts under the debugger. Everything works fine when I run the console application autonomously. Everything works fine when I pack everything in MSI and install it on the 2003 server and run the console application.

If I take the same MSI and install it on the 2008 server with UAC enabled, and then run the console application, I get the following messages:

Unable to set right for the account "DOMAIN\QAUSER": SeCreateGlobalPrivilege
System.UnauthorizedAccessException    Attempted to perform an unauthorized operation.

I cannot expect my deployment / server administrators to do anything with my application other than installation, and they will not disable UAC. There must be some programmatic way to correctly set the user rights that I can add to the console application - does anyone know how?

Thank.

+3
source share
2 answers

, "" " , (, RD Session Host). , SE_CREATE_GLOBAL_NAME (SeCreateGlobalPrivilege) . . # - SeDebugPrivilege? ( SE_CREATE_GLOBAL_NAME SE_DEBUG_NAME) , .

+1

, UAC 2008 , , .

, , app.manifest VS ( )

<requestedExecutionLevel  level="asInvoker" uiAccess="false" />

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

, UAC.

0

Source: https://habr.com/ru/post/1767892/


All Articles