Event though my question is somewhat development-related, I believe it's more of an IT Pro question, so please keep reading if you're not a developer!

I am developing a custom Service Application. I have a Farm scoped Feature Receiver to add instances of my SPService, SPServiceProxy and SPServiceInstance derived types to the Farm.

Regarding the SPServiceInstances, I iterate through each SPServer in SPFarm.Local.Servers and if it's an Application Server or a Web Front End, I register an instance of my SPServiceInstance derived type against the SPServer. This all works well, and it allows me to go into Central Admin and start/stop the service on a particular server using the Services on Server page.

Now, what if we decided to add a few more servers to the farm after we have activated our abovementioned Farm scoped feature and created the Service Application etc, and we need these new servers to also run our existing Service Application? These new Servers will not have the SPServiceInstance registered against them, so the Service cannot be started on these Servers. I don't like the idea of deactivating / activating the feature. Also, this problem must also exists for out-of-the-box Service Applications, so there must be a recommended way of handling this scenario. Can anyone point me in the right direction? Is PowerShell the answer?


2 Answers 2


When you add a new server to your farm you have to run either PSConfig or Powershell to provision SharePoint services.

In Powershell you run


You still need to define which services will actually run on the server. Essentially, your custom service would follow the same process, install on new server, than start the service.

  • Thank you Jesus :) The example at technet.microsoft.com/en-us/library/ff607705.aspx has a comment saying "This example installs all services, service instances and service proxies specified in the registry on the local server computer.". I am wondering what exactly they mean by "the registry". Do you think there is a windows registry key that holds this information? If so, how is it managed? Thanks! Jul 21, 2011 at 14:36
  • @Jaap, I can not say for sure how those keys are managed or where they are stored. There are no "automated" schemes for SP 2010, even for the OOTB service apps. Each server needs these copied and installed on them independently. It just so happens you do that when you install SP2010 on the box. If you look at the docs for deploying Office Web Apps or Project Server, you need to run the setup on each server, and these deployed as Service Applications. Jul 21, 2011 at 16:21
  • 1
    Not sure if you have already located it, but I found the key HKLM\Software\Microsoft\SharedTools\Web Server Extensions\14.0\WSS\Services I'm not sure if its added when you install the bits or when you first create the farm. Jul 22, 2011 at 19:30

It depends how psconfig adds the server to the farm, it may call code to add each service to the new SPServer instance.

Your problem is there is no "hook" into the "add server" event in which you can call your code to register SPServiceInstance.

I'm surprised that the new SPServiceInstance isn't automatically added to the new SPServer instance when it's created?

How are you adding the new server to the farm? Can you not control this with powershell hence giving yourself the ability to grab an instance of the new SPServer object when it's created and manually adding the SPServiceInstance to it?

  • Thanks for your answer Lee. I have to admit I have not actually tried to add the additional server to the farm yet; I am assuming it will not add the SPServiceInstance automatically, otherwise I don't see why I would have to add them in the Feature in the first place. I am sure I can write some powershell to add the SPServiceInstance after the Server was added, but I am mainly wondering if this is THE recommended way of handling this scenario. I guess it's more of an IT Pro question? Jul 21, 2011 at 11:10
  • No worries Jaap, I'm not in the know enough to be able to answer your question really, just thought I would put some ideas out there.
    – Lee Dale
    Jul 21, 2011 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.