zoukankan      html  css  js  c++  java
  • 使用PowerShell得到SharePoint的Application Pool

    使用命令Get-SPServiceApplicationPool得到Services所使用的Application Pool

    举例:

    PS C:\Users\administrator.VSAT> $svcpools=get-spserviceapplicationpool
    PS C:\Users\administrator.VSAT> $pool1=$svcpools|?{$_.name -eq "SharePoint Services App Pool"}
    PS C:\Users\administrator.VSAT> $pool1

    Name                                     ProcessAccountName
    ----                                     ------------------
    SharePoint Services App Pool             VSAT\administrator

    注意, 下面是使用foreach的方法来得到某个指定的application pool. Foreach命令明显没有pipeline的写法简单哦.

    PS C:\Users\administrator.VSAT> foreach($svcpool in $svcpools) {if($svcpool.Name -eq "SharePoint Services App Pool") {$pool2=$svcpool} }
    PS C:\Users\administrator.VSAT> $pool2

    Name                                     ProcessAccountName
    ----                                     ------------------
    SharePoint Services App Pool             VSAT\administrator

    使用如下的命令来得到所有web application使用的application pool

    PS C:\Users\administrator.VSAT> $pools = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools
    PS C:\Users\administrator.VSAT> $pool3=$pools | where {$_.Name -eq "SharePoint Hosting Pool"}

    注意, SharePoint Services所使用的App Pool在IIS中并不显示名字, 显示的是它对应的GUID.

    下面的命令可以帮助你将ID和名字对应起来.

    PS C:\Users\administrator.VSAT> $svcpools=get-spserviceapplicationpool

    PS C:\Users\administrator.VSAT> foreach($svcpool in $svcpools) {$svcpool.id.tostring() + " "+ $svcpool.name}
    0ac86057-a06f-4156-b388-62540d6a4769     FASTSearchAdminServiceAppPool
    c334555a-9e7b-469d-bdee-a4a40e831015  FASTSearchQueryAndSettingsAppPool
    69693b39-2a7e-4931-b1bc-3e20bd2e3c3b  SecurityTokenServiceApplicationPool
    9c03d8ea-0fa5-4850-9b76-b4e1018350ca    SharePoint Services App Pool
    881b143d-cea5-4d2c-a319-ddb2ebf19de4  SharePoint Web Services System
    PS C:\Users\administrator.VSAT>

    image

    参考资料

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

    Automating Microsoft SharePoint 2010 with Windows PowerShell 2.0 (book excerpt)

    http://technet.microsoft.com/en-us/library/hh393957.aspx

    Get-SPServiceApplicationPool

    http://technet.microsoft.com/en-us/library/ff607544.aspx

  • 相关阅读:
    办公室搞笑记(2) 李姐
    世界上疼我的人又少了一个
    带给杨帆的祝福:)
    火:) 火:) 火:)
    我们都是享受寂寞的孩子:)
    복 경 에 갑 니 다 :) 去北京.
    너는 겨울이 좋아요 .我喜欢冬天:)
    2007年:新年,新开始:)
    Nginx 泛域名配置方式
    数据库设计 从零开始系列之一
  • 原文地址:https://www.cnblogs.com/awpatp/p/2329173.html
Copyright © 2011-2022 走看看