Run the get-spserviceapplicationpool command to obtain the application pool used by services.
Example:
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
Note: The following describes how to use the foreach method to obtain a specified application pool. The foreach command is obviously not easy to write as 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
Run the following command to obtain the application pool used by all web applications:
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 "}
Note: The app pool used by Sharepoint Services does not display the name in IIS, And the guid corresponding to it is displayed.
The following command can help you map the ID and name.
PS c: \ Users \ administrator. VSAT> $ svcpools = Get-spserviceapplicationpool
PS c: \ Users \ administrator. VSAT> foreach ($ svcpool in $ svcpools) {$ svcpool. Id. tostring () + "" + $ svcpool. name}
0ac86057-a06f-4406-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>
References
========================
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