Thursday, March 26, 2009

Script to Restart SharePoint Services

 

Script to Restart SharePoint Services

Since my previous post introduced one of my SharePoint Toolbox scripts, I thought I should share another one that is more applicable to a broader audience.

As I've noted in the past, memory leaks are certainly not uncommon in the world of SharePoint. Consequently, you may want to periodically simulate a reboot of your development environment in order to free up memory and get back to being productive. Trust me, simulating a reboot is much, much faster than actually rebooting.

To do this, I created the following script and dropped it in my SharePoint Toolbox folder (\NotBackedUp\Public\Toolbox\SharePoint\Scripts\Restart SharePoint Services.cmd):

@echo off

@echo Stopping services...

iisreset /stop /noforce

net stop "Windows SharePoint Services Timer"

net stop "Windows SharePoint Services Administration"

net stop "Office SharePoint Server Search"

net stop "Windows SharePoint Services Search"

net stop "Windows SharePoint Services Tracing"

@pause

@echo Starting services...

net start "Windows SharePoint Services Tracing"

net start "Windows SharePoint Services Search"

net start "Office SharePoint Server Search"

net start "Windows SharePoint Services Administration"

net start "Windows SharePoint Services Timer"

iisreset /start

@pause


Note that I use a pause statement so that I can optionally perform other tasks while SharePoint is stopped (e.g. detach a database, move it to a different disk, and then reattach it).



Published Thursday, March 26, 2009 7:33 AM by Jeremy Jameson




Random Musings of Jeremy Jameson : Script to Restart SharePoint Services

1 comment:

daspeac said...

I have heard about another way of microsoft sql server 2005 data recovery. Besides, you can visit my blogs at: http://daspeac.livejournal.com/ or http://daspeac.blogspot.com/ where I’m trying to share my experience with regard to data corruption issues.

Blog Archive