How to get all sandboxed (user solution) installed on the SharePoint farm.
 $gc = Start-SPAssignment $gc | Get-SPSite | Get-SPUserSolution Stop-SPAssignment $gc
The output:
Name                                SolutionId                                                      Status 
  
----                                     ----------                                                         ------ 
  
Contacts.wsp                   3089ef04-527e-4b35-a0a2-af5f4df8a71b     Activated 
  
Sandboxed1.wsp              a9240922-c794-433c-acf7-0ce7863b46d0 Deactivated 
  
Sandboxed1.1.wsp           a9240922-c794-433c-acf7-0ce7863b46d0 Activated 
  
Sandboxed1.1.wsp           a9240922-c794-433c-acf7-0ce7863b46d0 Activated 
  
Sandboxed1.2.wsp           a9240922-c794-433c-acf7-0ce7863b46d0 Deactivated 
  
Sandboxed1.wsp              a9240922-c794-433c-acf7-0ce7863b46d0 Activated
It is really simple to get a full list of sandboxed solutions, but the output is not useful, because we can see which site collection the sandboxed solution is store in.
This small PowerShell script will display the site collection url
 function Get-UserSolution { param( [Parameter( Position=0, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true) ] $SiteCollection ) process { Write-host "Site Collection:" $SiteCollection.Url $gc = Start-SPAssignment $SiteCollection | Get-SPUserSolution -AssignmentCollection $gc Stop-SPAssignment $gc } } Get-SPSite | Get-UserSolution
The output:
Site Collection: http://win-ugka6ujlm21
Name                               SolutionId                                                       Status                
----                                    ----------                                                          ------                
Contacts.wsp                   3089ef04-527e-4b35-a0a2-af5f4df8a71b     Activated             
Sandboxed1.wsp              a9240922-c794-433c-acf7-0ce7863b46d0 Deactivated           
Sandboxed1.1.wsp           a9240922-c794-433c-acf7-0ce7863b46d0 Activated             
Sandboxed1.1.wsp           a9240922-c794-433c-acf7-0ce7863b46d0 Activated             
Sandboxed1.2.wsp           a9240922-c794-433c-acf7-0ce7863b46d0 Deactivated           
Site Collection: http://win-ugka6ujlm21/my 
  
Site Collection: http://win-ugka6ujlm21/sites/sandbox 
  
Sandboxed1.wsp              a9240922-c794-433c-acf7-0ce7863b46d0 Activated   
The code: 
  
Thanks, this is helpful
ReplyDelete