# SharePoint 2010 Local Dev Workstation Services START script
#
# Scripts written by Emmanuel Bergerat (emberger@microsoft.com) on Nov. 24th 2009
# Provided as is, and can be freely modified and distributed
# Enjoy!
#
# Start local SQL Services
"Starting Local SQL Services"
"MSSQLSERVER","SQLWriter","SQLSERVERAGENT" | ForEach-Object { $servicePrior = get-service $_
"$_ is " + $servicePrior.status + " and will be Started"
Start-Service $_
$serviceAfter = get-service $_
"$_ is now " + $serviceAfter.status }
"=> Local SQL Services Started"
" "
# Start IIS
"Starting IIS"
"W3SVC" | ForEach-Object { $servicePrior = get-service $_
"$_ is " + $servicePrior.status + " and will be Started"
Start-Service $_
$serviceAfter = get-service $_
"$_ is now " + $serviceAfter.status }
"=> IIS is Started"
" "
# Start SharePoint 2010 Services
"Starting SharePoint Server 2010"
"SPTimerV4","DCLoadBalancer14","DCLauncher14","SPWriterV4","SPUserCodeV4","SPTraceV4","SPAdminV4","WebAnalyticsService" | ForEach-Object { $servicePrior = get-service $_
"$_ is " + $servicePrior.status + " and will be Started"
Start-Service $_
$serviceAfter = get-service $_
"$_ is now " + $serviceAfter.status }
"=> SharePoint Server 2010 is Started"
" "
# Start SharePoint Search
"Starting SharePoint Search 2010"
"OSearch14","SPSearch4" | ForEach-Object { $servicePrior = get-service $_
"$_ is " + $servicePrior.status + " and will be Started"
Start-Service $_
$serviceAfter = get-service $_
"$_ is now " + $serviceAfter.status }
"=> SharePoint Search 2010 is Started"
" "
"Warming up local SharePoint WebApplications"
$snapin = Get-PSSnapin | Where-Object { $_.Name -like "Microsoft.SharePoint.PowerShell"}if ([bool]$snapin) {} else {Add-PsSnapin Microsoft.SharePoint.PowerShell}function Warmup-Site([string]$url)
{ $wc = New-Object net.WebClient
$wc.credentials = [System.Net.CredentialCache]::DefaultCredentials;
return $wc.DownloadString($url)
}
Get-SPWebApplication -IncludeCentralAdministration | Get-SPSite | ForEach-Object { Write-Host "Warming up site:" $_.Url ; $html = Warmup-Site -url $_.Url}"=> Local SharePoint sites warmed up"
" "
"=> SharePoint 2010 is started on this workstation... Do you still have free RAM? :-) <="