• 使用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

  • 相关阅读:
    zookeeper使用和原理探究(一)
    Zookeeper基本原理
    论照顾小孩与项目管理
    perl启动后台进程
    Oracle数据库迁移
    C# 语言Pagerank两种实现
    没文化真可怕--Silverlight 列冻结
    oracle中使用SQL递归语句的例子
    Visual Studio 2010 智能跟踪文件目录
    oracle wm_concat函数的应用(多行合成一行)
  • 原文地址:https://www.cnblogs.com/awpatp/p/2329173.html
Copyright © 2020-2023  润新知