In SharePoint 2010, a single PowerShell commandlet, Get-SPServiceApplicationPool, will list all application pools and their identities for service applications. However, there is no corresponding commandlet for directly listing application pools and their identities for web applications, but it can be done using piping:
Get-SPWebApplication | Select-Object DisplayName,{$_.ApplicationPool.Name},{$_.ApplicationPool.ID},{$_.ApplicationPool.UserName} | ft -autoIf you want to put the output directly into a file, just do this:
Get-SPWebApplication... | Export-CSV -Path "[Path]\[FileName.csv]"The column headers will be the default property names or expressions that you used. You can customize and improve the output column headers by doing this:
Get-SPWebApplication | Select-Object DisplayName, @{N="Application Pool"; E={$_.ApplicationPool.Name}}, @{N="ID";E={$_.ApplicationPool.ID}}, @{N="Identity"; E={$_.ApplicationPool.UserName}} | ft -autoIf you don't know the other ApplicationPool properties that you can get from Get-SPWebApplication, just do this:
$wa = Get-SPWebApplication -Identity "[web app name]"
$wa.ApplicationPool
References
- Get the application pool for a web application using the IIS7 PowerShell snap-in
- Get All Web Applications in SharePoint using PowerShell
- Finding the application pool account for a web application
- List of Sites and Application pools in IIS
Notes
- This also works for SharePoint 2013 and 2016.
No comments:
Post a Comment