SharePoint 2010 introduced the ability to host SharePoint on Windows 7 for development purposes… which is fantastic… no more VM. However, when SharePoint 2010 installs/configures services it configures them to start up automatically (or at minimum allows “Automatic” services to start “Manual” services). While this is great for my server… its not so great for my laptop with 4GB of memory. I can’t speak for you… but I’m not writing code 100% of the time… and that 2GB of memory can be used for other things when I’m not.
So, attached is a Powershell script that can be used to start/stop the services whenever you’d like. I had a few requirements for myself when writing this script:
Here’s a visual of the effects of the script on memory utilization:
The one note is that the script requires a UAC jump in order to manage the services… you have to select “Run as administrator” for it to work. This would be required on any UAC enabled system, so I don’t consider it much of a drawback. That being said, the fact that .ps1 extensions do not automatically have the “Run as administrator” option can be difficult, I’ve also included a registry export to enable this option. Just double-click the .reg file, and “Run as administrator” will be enabled for all Powershell scripts.
This is my first Powershell script, so feel free to leave a comment pointing out areas I could have done this better… :)
Genius, absolutely genius.
Thanks for the effort!
Still crazy, I mean useful, after all these years. Thanks!