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"

  • 相关阅读:
    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成Apps Office新的App模型
    android Notification 的使用(锁定通知栏)
    Android中经常使用的工具类02
    【python系列】python画报表(Chartkick、Flask)(附中文乱码解决方式)
    Nginx 笔记与总结(14)expires 缓存设置
    数据分析师、数据科学家常见的77个面试问题
    数据分析师、数据科学家常见的77个面试问题
    常见数据分析方法汇总
    常见数据分析方法汇总
    机器学习、数据挖掘、人工智能、统计模型这么多概念有何差异
  • 原文地址:https://www.cnblogs.com/by1455/p/1676523.html
Copyright © 2011-2022 走看看