RE: VB.NET Win Service throws SecurityException on ServiceControll



Hi George,

Thanks for your feedback. Your further information is helpful for us to
analysis this problem.

In the eventlog record, it tells us that your service runs under the
"2KAPPS\powr_winservice" account. Since you are calling the service
shutdown code in your own service code, the code runs under the
"2KAPPS\powr_winservice" account. Can you tell me what group
"2KAPPS\powr_winservice" account belongs to? Administrators or Users or
Domain Users? I suspect this account has no permission to stop the service
itself. If the Windows native security check fails for
"2KAPPS\powr_winservice" account, it may be mapped to the SecurityException
in .Net.

Can you help to confirm if the SecurityException is generated in
ServiceController.Close() method or ServiceController.Stop() method?

To verify this, you can download Process Explorer from the link below and
run it:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

1. In the process tree of "Process Explorer", find your service process
2. Double clicked this process record to bring up the properties dialog.
3. Switch to the "Services" tab
4. Click "Permissions" button for your service record.
5. You may find what permission is granted to the "2KAPPS\powr_winservice"
account or the groups it belongs to.

I will wait for your further information. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=========================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.

.


Quantcast