Wednesday, 31 August 2011

Sharepoint Dev TIP: Windows 7 services with SharePoint 2010

Hey all,
so we all have SharePoint 2010 with SQl on our 8GB dev machines (yay). A lot of the time I don't require this functionality (due to remoting to other environments) so it would be good to be able to stop a load of things to free up resources.
I have created two simple scripts which I use to turn services on and off. I appreciate that these are simple and are probably not necessarily definitive but its a good start.
Copy the commands, save as a .bat file and you are off.

echo Stopping sql server
C:\Windows\System32\net.exe stop mssqlserver
echo  sql server stopped
Echo stopping Sharepoint timer (OWSTIMER)
C:\Windows\System32\net.exe stop SPTimerV4
Echo Sharepoint timer (OWSTIMER) stopped
echo  Stopping iis
C:\Windows\System32\iisreset.exe /stop
echo  iis stopped

echo Starting Forefront Identity Manager Service (Cos it got shut down in the sql stop
C:\Windows\System32\net.exe start FIMService
echo Forefront Identity Manager Service Started
echo Starting sql server
C:\Windows\System32\net.exe start mssqlserver
echo  sql server started
Echo Starting Sharepoint timer (OWSTIMER)
C:\Windows\System32\net.exe start SPTimerV4
Echo Sharepoint timer (OWSTIMER) started
echo  Starting iis
C:\Windows\System32\iisreset.exe /start
echo  iis started