I have a service which requires elevated administrative permissions. The service runs fine on Windows XP and Windows 2008r2 but when I run the code which checks to see whether the application is executing under an elevated administrative context on Windows 2012r2 - the result is always false.
I have already tried adding <requestedExecutionLevel level="requireAdministrator" uiAccess="true" />
to the application manifest and this works fine when I run the same code as a console application - but as a service, the application just executes without elevated permissions - failing to perform operations that require the administrative permissions.
Also, I am using the code in the accepted answer here to determine if I am running with elevated permissions.