How can I make a ServiceController fully-trusted and "run as administrator

I've written a (.net 4.0) windows service and service monitor program. For the monitor to work properly on windows 7 and vista it needs to be "fully-trusted' and compatibility needs to be set as "Run this program as administrator".

How can I set the trust level and the compatibility either in code or during setup. I will not have any access to the PC the service is loaded on so doing anything manually after the install is not an options.

Bob HoffmanDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

By default only Administrators and LocalSystem has the access rights required to (Start/Stop/Pause) services. There is a couple of options to consider.
Create a service that runs under (LocalSystem) that is responsible for (Starting/Stopping/Pausing) the worker services required. Since local users have QUERY_STATUS access right your GUI application can always query if the monitor service is running but when it needs to actually (Start/Stop/Pause) that service you can issue a custom command to the monitor service that would do that for you(permission granted). You may be thinking well what is the point of another service? Well the monitor service is a critical dependancy that ensures all your work services are set in motion and running properly. If your GUI controller determines that the monitor service itslef isn't running you must inform the user it's a requirment for the application to run properly and it should be enabled manually with the administrative account.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob HoffmanDeveloperAuthor Commented:
I like that approach, I'll let you know in a day or so if it worked. Thanks
Bob HoffmanDeveloperAuthor Commented:
Worked like a charm! Great way to get around the security issues. Thanks for the help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.