我正在执行库存,我需要获取部署到每个单独的web应用程序的SharePoint解决方案(* .wsp)列表,理想情况下,列出Web服务器上的Web服务器上的应用程序池也很棒 - 应用属于?

这样的东西>>

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

我已经尝试了使用 get-spsolution ,但输出不包含web-app name和 get-spwebapplication 没有给出.wsp的列表列出的每个Web应用程序。

stsadm -o enumsolutions 似乎包含我需要的信息,但不知道如何将输出格式更改为类似于上面类似的东西。

这是MS SharePoint Server 2010在W2K8R2 STD上运行。

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
scroll top