.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Unable to enum ManagedComputer.Services & Stop/Start SQL Agent service from ASP.NET app

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :
Hi guys

I have some code that stops/starts the SQL Server Agent service from within our ASP.NET web application.  Runs fine in development but doesn't in release - I suspect due to rights: Dev has admin rights, whereas Prod is running under a IIS application pool identity which is a domain account (e.g. IUSR_WEBAPP).

In Production it doesn't return any ManagedComputer.Services - ManagedComputer.Services.Count = 0. It doesn't throw any exceptions or anything, just not return any services or allow me to access the specific SQL Agent instance that I want to.

I've tried granting access in various places including WMI but nothing seems to work.  I cannot figure out what rights might be needed.

How can I grant access to my application pool account so that it can enumerate services and stop/start my specific SQL Agent account instance for 2005/2008?

Many thanks

View Complete Post

More Related Resource Links

Unable to connect to local host service when a splash screen is show before start the services

Hi all:

I want to show a splash screen before start the local host services, the host can be open without error, however the client (Form1) is not able to connect to the service. Without the splash screen, every thing work fine. Any idea why ?

Here is the code.

Imports System.ServiceModel

<ServiceContract()> _
Public Interface IHelloWorldService
   <OperationContract()> _
   Function SayHello(ByVal name As String) As String
End Interface

Public Class HelloWorldService
   Implements IHelloWorldService

   Public Function SayHello(ByVal name As String) As String Implements IHelloWorldService.SayHello
      Return String.Format("Hello, {0}", name)
   End Function
End Class

Module Module1
   Private host As ServiceHost
   Private frmSplash As Form

   Sub Main()
      AddHandler AppDomain.CurrentDomain.AssemblyLoad, Addres

Unable to start/stop SharePoint 2010 service



I've developed customs SharePoint 2010 Service based on this tutorial: http://blogs.msdn.com/b/dtaylor/archive/tags/calculator+service+example/

My first version inherits from SPIisWebService (and SPIisWebServiceInstance, SPIisWebServiceApplication etc..) - everything worked fine.

Then I redesigned my service to inherits from SPWindowsService (and SPWindowsServiceInstance, SPWindowsServiceApplication etc...). Everything works fine without one thing:) - I'm not able to start or stop Service (neither from PowerShell nor SP Central Admin page). After installed my service, it is started. When I uninstall it and install once again - it's still started.

When I try to stop it (or start on clear SharePoint environment), I've got the following exception (where IntegrationService is the name of my service)

System.ComponentModel.Win32Exception: IntegrationService
at Microsoft.SharePoint.Win32.SPAdvApi32.SetServiceStartupType(String serviceName, Int32 startupType)
at Microsoft.SharePoint.Administration.SPWindowsServiceInstance.Provision(Boolean start)
at Microsoft.SharePoint.ApplicationPages.ServerPage.OnObjectModelAction(Object sender, ObjectModelActionEventArgs e)
at Microsoft.SharePoint.WebControls.ActionLinkDataSourceControl.OnObjectModelAction(ObjectModelActionEventArgs e)
at Microsoft.SharePoint.WebControl

Unable to start user profile synchronization service

Hello, I have the following problem. user profile synchronization service doesn't start up, with the following error in log: The service encryption keys could not be found. User Action Verify that the service account has permissions to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Forefront Identity Manager\2010\Synchronization Service If the problem persists, run setup and restore the encryption keys from backup. Permissions for registry are availabele. Thank you.    

Unable to start SQL Express 2005 service as a network user

I am trying to start ms sql server 2005 express as a network user from originally starting as local system. I cannot start the service.I have given this network user administrator access to sql express from the sql server surface area configuration "Add New Administrator". I have went into the local users/groups and added this network user to the 3 security groups SQLServer2005MSSQLServerADHelperUser$SQL1SQLServer2005MSSQLUser$SQL1$SQLEXPRESSSQLServer2005MSSQLBrowserUser$SQL1I receive one alert int he event logs/applicationEventID: 26010The server could not load the certificate it needs to initiate an SSL connection. It returned the following error: 0x8009030d. Check certificates to make sure they are valid.I receive five errors in the event logs/applicationEventID: 26014Unable to load user specified certificate. The server will not accept a connection. You should verify that the certificate is correctly installed. See "Configuring Certificate for Use by SSL" in Books Online.EventID: 17182TDSSNIClient initialization failed with error 0x80092004, status code 0x80EventID: 17182TDSSNIClient initialization failed with error 0x80092004, status code 0x1EventID: 17826Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately prceding this one in the error log.EventID: 17120SQL Serve

Cannot start Analysis Services 2008 service

Hi! I have Sql Server 2008 R2 and Analysis Services 2008. I could use it without problems for few days, but today, when I stop analysis service with Sql Server Configuration Manager and tried to start it again, it gives me error message: "The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details". The msmdsrv.log file doesnt have any entries related to this error. Both Sql Server and AS are installed on my local machine and log on as LocalSystem. My system is XP sp3 professional.

How to start/stop SharePoint 2010 Services manually?



I am new to SP 2010.  Recently, I installed SharePoint 2010 on Windows 7 (4GB RAM), which is taking up most of my system RAM and I am unable to run any New Virtual PC within my Host.  I would like to start/stop SharePoint 2010 manually on this PC.

What are the steps (in proper sequence) involved to start/stop all SharePoint 2010 related services manually? 

Thanks & Regards,
Kamlesh | Blog | Twitter 
Posting is provided "AS IS" with no warranties, and confers no rights.

Reporting Service Integration, Unable to access Reporting Services Site Settings


I am attempting to get reporting services running in integrated mode with sharepoint 2010. I have everything installed and features turned on. In the site collection, when I click on  Site Settings > Reporting Services Site Settings, I am presented with:

Error: The request failed with HTTP status 401: Unauthorized.


I get virtually zero hits when searching for this. Any help is appreciated.


can't start User Profile syncronization Service or FIM services


Using 2k8 R2, SQL 2k8 SP1 CU5 and Sharepoint 2010 RC. Standalone install with DC on separate server

Install to vanilla AD - can't do anything until I can get this service running and I can't run it because when I try to start it and I get a screen that lists the Service app - fine - but the service account is greyed out and listing NTAuthority\NetworkService - it demands a password but of course I can't priovide one. Can't select a different Service account because it's all greyed out - even if I create a new managed account and add that as an Admin to the Service Application

FIM services both won't start either -

Out of box install and nothing works - hardly bodes well

Anyway - seen lots of posts on problems with starting this service - anyone found a solution?





Cannot start SQL Server Agent service on Cluster , 2008 R2



I'm testing a two node cluster installation on windows 2008 r2 and sql server 2008 r2 both enterprise before a production deployment and my only issue so far is that the SQl Server Agent service cannot be started.

The failover works fine, the cluster and SQL services changes nodes without any problem but on both nodes i cannot start that service.

I'm using a domain user for the service, member of the local admin and sysadmin on the SQL server itself.

The error i get when i click on start from SQL management console is:

Unable to start service SQLAGENT$SQLTEST on server SERVERNAME. (mscorlib)

Program Location:

Server stack trace: 
 at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Service.Start()
 at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args,
 Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md,
 Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink
replySink) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.R

Unable to start sql server Agent




I am not able to start the Sql server Agent, when I am trying to start it is displaying the error msg "The Dependent services has not started"


Please help me in this issue

Unable to install SQL Server 2005 Express Edition with Advanced Services Service Pack 4 (KB2463332)



Rookie here. Using SQL for an eBay software program we have been running for two years. There were simple step by step instructions to install -- point being, I really dont understand this stuff.

Running Windows XP SP3.

Automatic Updates is trying to install the version shown in the Title of this message. It fails to install and gives me the error: SQL BPA command line has encountered a problem and needs to close.

I do not know where to access the error log. I will post if someone can tell me the correct one to find. In the following directory, C:\Program Files\Microsoft SQL Server\, there are directories for MSSQL.1, MSSQL.2 and MSSQL.3. Two of them show log directories with today's date.

Any and all help is very much appreciated.

Thank you!

SOA Simplified: Service Virtualization With The Managed Services Engine


By using Managed Services Engine service virtualization technology, you can begin participating in the cloud by simply configuring virtual service endpoints and operations that integrate with the .NET Service Bus.

Aaron Skonnard

MSDN Magazine May 2009

Service Station: An Introduction To RESTful Services With WCF


We discuss some of the basic tenets of REST as well as present an implementation of a RESTful service using WCF.

Jon Flanders

MSDN Magazine January 2009

Service Station: Authorization In WCF-Based Services


Windows Communication Foundation (WCF) provides an easy role-based system and a more powerful and complex claims-based API for implementing authorization in services.

Dominick Baier and Christian Weyer

MSDN Magazine October 2008

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Service Station: Developing .NET Web Services with Beta 2


Version 2. 0 of the Microsoft® . NET Framework makes numerous improvements at various levels in the Web services protocol stack. In addition, better tool support and an increased focus on interoperability make your life easier.

Aaron Skonnard

MSDN Magazine April 2005

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend