zoukankan      html  css  js  c++  java
  • [持续更新]一些有用的PowerShell收集

    [2012-09-05]

    可以使用下面的powershell命令来dump某web application中符合某条件的timerjob, 比如说, 下面的命令dump出端口在1007的web application的variation timer job.

    PS> (get-spwebapplication http://servername).JobDefinitions | where {$_.DisplayName -match "variation"} | select DisplayName, IsDisabled, LastRunTime, Schedule | fl

    使用下面的powershll来查看某个timer job的历史记录. 比如说, 下面的命令dump了端口在1007的web application中所有的variation timer jobs的历史记录.

    PS> (get-spwebapplication http://servername).JobHistoryEntries | where {$_.JobDefinitionTitle -match "variation"}

    下面的dump了"Variation create hierarchies job definition"的所有job history

    PS> (get-spwebapplication http://servername).JobHistoryEntries | where {$_.JobDefinitionTitle -match "Variations Create Hierarchies Job Definition"}

    使用下面的powershell来dump与某个page library相关联的所有的event receivers.

    PS> (get-spweb http://servername/en).Lists["Pages"].EventReceivers | select Type,Class | fl

    使用下面的powershell命令来dump出于某个站点相关联的所有的event receivers.

    PS> (get-spweb http://servername/en).EventReceivers | select Type,Class | fl

    使用下面的powershell命令来dump从SPFile对象中dump出二进制信息, 写到文件系统中去.

    PS> $byteArr = ((get-spweb http://server).Lists["Master Page Gallery"].Items | where{$_.Name -match "VariationRootPageLayout.aspx" }).File.OpenBinary()

    PS> [System.IO.File]::WriteAllBytes( "c:\VariationRootPageLayout.aspx", $byteArr)

    当Microsoft SharePoint Foundation Administration是disabled的状态时, 可以使用下面的脚本来启动它. 感谢Eric Zhang提供此脚本.

    $LocalServer =$null
    $LocalServer = [Microsoft.SharePoint.Administration.SPServer]::Local;
    $srvList = $LocalServer.ServiceInstances

    foreach($srv in $srvList)
    {
            $a = $srv.Service.GetType().FullName
            if ($a.Contains("Microsoft.SharePoint.Administration.SPAdministrationService"))
            {
                write-host $a ":" $srv.Status
                            $srv.Provision()
            }
    }

    资料来源

    ============================

    SharePoint Variations – The complete Guide – Part 14 – Troubleshooting

    http://blogs.technet.com/b/stefan_gossner/archive/2011/11/30/sharepoint-variations-the-complete-guide-part-14-troubleshooting.aspx

  • 相关阅读:
    PHP $_SERVER 变量
    $_SERVER变量 以及 PHP 使用 $_SERVER['PHP_SELF'] 获取当前页面地址及其安全性问题
    Funs
    搞定,务必记得要以最简便的整合资源来做
    还是要好好研究开源的php
    重回编程
    登录弹窗代码(居中)
    测试工具了解指南
    工作总结1
    HTML5 contextmenu隐藏鼠标右键菜单
  • 原文地址:https://www.cnblogs.com/awpatp/p/2671777.html
Copyright © 2011-2022 走看看