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"

  • 相关阅读:
    看看自己敲了多少代码
    jquery中获取单选标签redio的val
    @functools.wrapes
    SQLAlachemy 自动提交配置 SQLALCHEMY_COMMIT_ON_TEARDOWN
    ajax 常用格式
    开发文档收藏
    falsk 请求钩子
    数组中出现次数超过数组长度一半的值 分类: C/C++ 2015-07-09 15:38 142人阅读 评论(0) 收藏
    二叉搜索树(C++) 分类: C/C++ 数据结构与算法 2015-07-09 11:18 205人阅读 评论(0) 收藏
    程序员必读的六本书 2015-07-08 11:26 21人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/by1455/p/1676523.html
Copyright © 2011-2022 走看看