SharePoint Use Cases

07 Jul, 2010

Retract SharePoint solution from Central Admin with PowerShell

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

I deployed a custom made solution to the SharePoint 2010 Central Administration application. However when I tried to remove the solution and failed from both PowerShell and GUI. The solution remained in the Deployed state. After examining the log files I figured out that SharePoint timer iterates all the web applications except central admin.

Here is the PowerShell script to remove a solution that was deployed to Central Admin Application.

# check to ensure Microsoft.SharePoint.PowerShell is loaded
<pre>$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null) {
  Write-Host "Loading SharePoint Powershell Snapin"
  Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
$centralAdmin = Get-SPWebApplication -includecentraladministration | where {$_.DisplayName -eq "SharePoint Central Administration v4"} | select Url
$solutionName = Read-Host "Please enter your solution name (e.g. MySolution.wsp)"
Uninstall-SPSolution -Identity $solutionName -WebApplication $centralAdmin.Url -Confirm:$false

Hope this helps!



Documentation Toolkit for SharePoint

Comments

1 | Tweets that mention Retract SharePoint solution from Central Admin with PowerShell | SharePoint Use Cases -- Topsy.com

July 7th, 2010 at 6:44 am

Avatar

[...] This post was mentioned on Twitter by Planet SharePoint. Planet SharePoint said: Toni Frankola: Retract #SharePoint solution from Central Admin with PowerShell http://planetsharepoint.org/1c7eca [...]

Comment Form


About

Real-life use case and opinions about collaboration, CRM and web technologies and stuff by Toni Frankola. More...

Toni Frankola - SharePoint MVP Profile

All postings on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer.

Page optimized by WP Minify WordPress Plugin