Powershell scripts for SharePoint 2010 services – ‘Stop & Start’

Powershell scripts for SharePoint 2010 services – ‘Stop & Start’

We all now know that SharePoint 2010 is resource intensive, especially intensive with its ram usage.

I originally installed full blown SharePoint 2010 on my laptop (which has 4gb of ram) only to see most of that ram being used up and none left for visual studio to run.

I would recommend anyone who wants to install it on their workstation that only has 4gb of ram to install SharePoint Foundation instead which needs much less ram and will be fine for simple SharePoint 2010 dev or just playing around.

After I had installed it on my workstation I went on a search of some powershell scripts that I could use to stop SharePoint’s services when its not in use and start them up when needed.

It turns out Emmanuel Bergerat had created some and posted them on his blog, see here –

http://blogs.msdn.com/emberger/archive/2009/11/16/stop-and-go-with-sharepoint-2010-on-your-workstation.aspx

Thanks Emmanuel!

I have modified these scripts to work with SharePoint Foundation instead of full SharePoint Server 2010.

You can find the scripts on my SkyDrive – link at the bottom of the post.

To get them to work you will need to open them and edit the line –

‘MSSQL$SHAREPOINT’,"SQLWriter",’SQLAgent$SHAREPOINT’ | ForEach-Object

You need to change the name of the SQL Service (in my case MSSQL$SHAREPOINT) to the name matching yours. This name will depend on what your SQL instance is called, if you install SharePoint ‘standalone’ then it will most likely be the same as mine.

Run the scripts in the following order –

1. ‘Manual.ps1’ – Sets services to manual startup (Only need to run this once)

2. ‘Start.ps1’ – Starts SQL & SharePoint Foundation services

3. ‘Stop.ps1’ – Stops SQL & SharePoint Foundation services

Hope this helps! :-)

 

Link: SharePoint Foundation Powershell Scripts

2 thoughts on “Powershell scripts for SharePoint 2010 services – ‘Stop & Start’

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">