SharePoint Server 2010: Accidentally stopped your Central Administration service? Start it again with PowerShell!

OK, I had one of those days yesterday.  I was working on my various servers and Hyper-V images to get them all patched and also wanted to update my SQL Server, but rather than shut down my Project Server 2010 application server I thought I’d just stop all the service in Central Administration.  Including Central Administration itself…  If you haven’t tried that one then you will go from this:


to this, when you click Stop.


Excellent!  A chance to learn some more PowerShell, as I was sure there must be some way of recovering from this from the SharePoint 2010 Management Shell.  So using the wonderful TAB feature to auto complete commands I soon found, by opening the Management Shell as administrator, typing start and then TAB a few times the command I needed – Start-SPServiceInstance.  I guess get-command, or gcm start* would have been nearly as quick.  A quick look at get-help start-SPServiceInstance and I found I needed the GUID (Identity) that represented the Central Administration service.  Come on, you all know yours by heart?  Get-SPServiceInstance came to the rescue, but I knew there was a better way than cutting and pasting the GUID after first sifting through all the services… (Tip – Get-SPServiceInstance | fl > servicelist.txt makes it a bit easier to read).  I should be able to pipeline the filtered output from my Get command through to my Start command.  So a few minutes and syntax checks later I had it solved:

Get-SPServiceInstance | Where-Object {$_.TypeName –eq ‘Central Administration’} | Start-SPServiceInstance

and my Central Administration site was back and available!  If you try this and it just sticks at provisioning then perhaps your SharePoint Timer Service is not running (Check Administrative Tools, Services on the application server) .  You can check the status with:

Get-SPServiceInstance | Where-Object {$_.TypeName –eq ‘Central Administration’}

it should eventually say Online.  It will say Disabled before you start it, and then Provisioning and finally Online.

It is certainly worth getting to know what PowerShell can do to automate SharePoint.