zoukankan      html  css  js  c++  java
  • [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"

  • 相关阅读:
    用Visual C#实现文件下载
    解读C#中的规则表达式
    NET(C#)连接各类数据库集锦
    C#中编写多线程(1)——起步
    C#中的常用加密算法与其它语言的兼容性
    C#的事件处理机制应用
    TCP IP协议之通信详解
    手把手教你AspNetCore WebApi:认证与授权
    TCP IP协议之初识
    mysql中exit和in的区别
  • 原文地址:https://www.cnblogs.com/by1455/p/1676523.html
Copyright © 2011-2022 走看看