I can search for websites using:
Get-WmiObject -Namespace \"root\\WebAdministration\" -Class Site -Authentication PacketPrivacy -ComputerName $servers
Try the following:
[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
$sm = New-Object Microsoft.Web.Administration.ServerManager
foreach($site in $sm.Sites)
{
$root = $site.Applications | where { $_.Path -eq "/" }
Write-Output ("Site: " + $site.Name + " | Pool: " + $root.ApplicationPoolName)
}
The script above lists every site on the server and prints the root application pool name for each site.