Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm performing an inventory and I need to get list of sharepoint solutions (*.wsp) deployed to every individual web-application and ideally, it would also be great to list what Application pool on what web-server this web-application belongs to?

Something like this >>

solution-name.wsp / web-application-name / application-pool-name

I've tried using Get-SPSolution, but output doesn't contain web-app name & Get-SPWebApplication doesn't give the list of .wsp for each web-app listed.

stsadm -o enumsolutions seems to contain info I need, but don't know how to change output format to something similar mentioned above.

This is MS SharePoint Server 2010 running on W2K8R2 STD.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

First, get all your web applications and iterate through them. While in the loop print web application name and application pool name. Last, iterate all solutions and print their names - like this:

$contentWebAppServices = (Get-SPFarm).services |
 ? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"}

foreach($webApp in $contentWebAppServices.WebApplications)
{
    Write-Host "Web Application  : " $webApp.name
    Write-Host "Application Pool : " $webApp.ApplicationPool.Name

    Get-SPSolution | ForEach-Object {
        if ($_.LastOperationDetails.IndexOf($webApp.url) -gt 0) 
        {
            Write-Host "    Solutions:"
            Write-Host "   " $_.DisplayName
        }
    }
} 

The output looks like this:

Web Application  :  SharePoint - 1337
Application Pool :  SharePoint - 1337
Web Application  :  SharePoint - 80
Application Pool :  SharePoint - 80
    Solutions:
    customer.intranet.wsp

The first web application (SharePoint - 1337) doesn't have deployed solutions, but the second (SharePoint - 80) has one.

share|improve this answer
1  
Perfect, I think this is what I need. –  Volodymyr Apr 10 '13 at 14:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.