I attempted to do some Win32 stuff in C# 3.5 to get elevated User Rights for a console app. I develop on Visual Studio 2008 SP1/GDR and things work fine when run under the debugger. Things also work fine when I run the console app stand-alone. Things also run fine when I package everything into an MSI and install it on a 2003 server and run the console app.
If I take the same MSI and install it on a 2008 server with UAC enabled, then run the console app, I get messages like this:
Unable to set right for the account "DOMAIN\QAUSER": SeCreateGlobalPrivilege
System.UnauthorizedAccessException Attempted to perform an unauthorized operation.
I cannot expect my deployment/server admins to do anything with my app other than install it, and they are not going to turn off UAC. There must be some programmatic way to properly set user rights that I can add to the console app - anyone know how?
Thanks.