Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-PSSnapin Microsoft.SharePoint.PowerShell
- $poolName = 'Service Applications' # leave blank to get all app pools on the server
- $serverNames = Get-SPServer | ? { $_.Role -ne "Invalid" } | % { $_.Name }
- Invoke-Command -ComputerName $serverNames -ScriptBlock {
- param
- (
- [parameter(Mandatory=$false)][string]$PoolName
- )
- Import-Module WebAdministration;
- foreach( $state in Get-WebAppPoolState -Name $PoolName )
- {
- [PSCustomObject] @{
- Server = $env:COMPUTERNAME
- AppPool = $state.ItemXPath.Replace( "/system.applicationHost/applicationPools/add[@name='", "").TrimEnd("']")
- Status = $state.Value
- }
- }
- } -ArgumentList $PoolName | SORT Server | FT Server, AppPool, Status -AutoSize
Add Comment
Please, Sign In to add comment