[SPS2010] 三个有关Sharepoint相关的服务的指令集

 

启动Sharepoint相关的服务 start.ps1

# Scripts written by Emmanuel Bergerat (emberger@microsoft.com) on Oct. 20th 2009

# Start local SQL Services
"Starting Local SQL Services"
"MSSQL`$SHAREPOINT","SQLWriter","SQLAgent`$SHAREPOINT" | 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"
" "

 

停止Sharepoint相关的服务 stop.ps1

# Scripts written by Emmanuel Bergerat (emberger@microsoft.com) on Oct. 20th 2009

# Stop IIS
"Stopping IIS"
"W3SVC" | ForEach-Object {
    $servicePrior = get-service $_
    "$_ is " + $servicePrior.status  + " and will be stopped"
    Stop-Service $_ -Force
    $serviceAfter = get-service $_
    "$_ is now " + $serviceAfter.status }
"=> IIS is STOPPED"
" "
# Stop SharePoint Search
"Stopping SharePoint Search 2010"
"OSearch14","SPSearch4" | ForEach-Object {
    $servicePrior = get-service $_
    "$_ is " + $servicePrior.status  + " and will be stopped"
    Stop-Service $_ -Force
    $serviceAfter = get-service $_
    "$_ is now " + $serviceAfter.status }
"=> SharePoint Search 2010 is STOPPED"
" "

# Stop SharePoint 2010 Services
"Stopping SharePoint Server 2010"
"SPTimerV4","DCLoadBalancer14","DCLauncher14","SPWriterV4","SPUserCodeV4","SPTraceV4","SPAdminV4","WebAnalyticsService" | ForEach-Object {
    $servicePrior = get-service $_
    "$_ is " + $servicePrior.status  + " and will be stopped"
    Stop-Service $_ -Force
    $serviceAfter = get-service $_
    "$_ is now " + $serviceAfter.status }
"=> SharePoint Server 2010 is STOPPED"
" "

# Stop local SQL Services
"Stopping Local SQL Services"
"MSSQL`$SHAREPOINT","SQLWriter","SQLAgent`$SHAREPOINT" | ForEach-Object {
    $servicePrior = get-service $_
    "$_ is " + $servicePrior.status  + " and will be stopped"
    Stop-Service $_ -Force
    $serviceAfter = get-service $_
    "$_ is now " + $serviceAfter.status }
"=> Local SQL Services STOPPED"
" "

手动Sharepoint相关的服务 config.ps1


# Scripts written by Emmanuel Bergerat (emberger@microsoft.com) on Oct. 20th 2009

"Setting all SharePoint 2010 related services to Manual Startup:"
# SQL Services set to Manual Startup
"MSSQL`$SHAREPOINT","SQLWriter","SQLAgent`$SHAREPOINT" | ForEach-Object {
    Set-Service $_ -startuptype manual}
    "  - SQL Services set to Manual StartUp"

# IIS Service to Manual Startup
    Set-Service "W3SVC" -startuptype manual
    "  - IIS Service set to Manual StartUp"

# SharePoint services set to Manual Startup
"SPTimerV4","DCLoadBalancer14","DCLauncher14","SPWriterV4","SPUserCodeV4","SPTraceV4","SPAdminV4","WebAnalyticsService" | ForEach-Object {
    Set-Service $_ -startuptype manual}
    "  - SharePoint Services set to Manual StartUp"

# SharePoint Search set to Manual Startup
"OSearch14", "SPSearch4"| ForEach-Object {
    Set-Service $_ -startuptype manual}
    "  - SharePoint Search set to Manual StartUp"
" "
"All SharePoint 2010 related services are now set to Manual Startup"

posted on 2010-03-02 15:11 by1455 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/by1455/archive/2010/03/02/1676523.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值