In this post we describe the technical procedure for cleanly uninstalling individual web parts. Each “AE” web part is a standalone farm solution (.wsp) – removal follows the order below. The steps can be applied independently per web part and are rollable back at any point (final section).
Overview
- Backup – site collection and farm backup
- Inventory – IDs from the product name (verified function) and affected pages
- Remove instances – take the web part off pages
- Deactivate feature – site-scoped feature across all webs
- Retract & delete – Uninstall-SPSolution + Remove-SPSolution
- Configuration – license keys from web.config
- Verification – check + data cleanup after approval
- Rollback – possible at any time: restore the backup from step 1
Step 1 – Backup
Before the first change, the site collection and the farm are backed up – this is the only way to enable a rollback:
# Back up the site collection
Backup-SPSite -Identity "https://intranet" -Path "C:\Backup\intranet_YYYY-MM-DD.dat" -SystemContent
# Farm backup (recommended)
$backup = Start-SPBackup -BackupDirectory "C:\FarmBackup\YYYY-MM-DD"
$backup.Execute()
Step 2 – Inventory: Where is the web part installed?
First we determine all required identifiers from the product name – feature ID, assembly, and web part type name. The following function reads the farm-wide feature definitions and the Hive; it has been verified on a SharePoint 2019 farm and returns the IDs used in step 4 directly:
Next we list all pages where the web part is in use (adjust the assembly name in the filter, e.g. AEEventManager):
# Get-SPWebpartIds – IDs from the product name (verified, SP 2019, 24.08.2026)
function Get-SPWebpartIds {
param([Parameter(Mandatory)][string]$Name)
$wild = if ($Name -like '*\*') { $Name } else { "*" + $Name + "*" }
$compact = if ($Name -like '*\*') { $Name } else { "*" + ($Name -replace '\s+', '') + "*" }
$res = New-Object System.Collections.ArrayList
# 1) Farm-wide feature definitions
if (Get-Command Get-SPFeature -ErrorAction SilentlyContinue) {
Get-SPFeature -ShowHidden | Where-Object { $_.DisplayName -like $wild -or $_.Assembly -like $compact } |
ForEach-Object {
[void]$res.Add([PSCustomObject]@{ FeatureId = $_.Id; FeatureTitel = $_.DisplayName; Scope = $_.Scope; Assembly = $_.Assembly; WebPartType = $null })
}
}
# 2) Hive: feature.xml (ID/title) + .webpart (full type name)
$spRoot = Join-Path $env:ProgramFiles 'Common Files\Microsoft Shared\Web Server Extensions'
$hive = @(Get-ChildItem $spRoot -Directory | Where-Object { $_.Name -match '^\d+$' } |
Sort-Object { [int]$_.Name } -Descending | Select-Object -First 1)
if ($hive -and (Test-Path (Join-Path $hive.FullName 'TEMPLATE\FEATURES'))) {
Get-ChildItem (Join-Path $hive.FullName 'TEMPLATE\FEATURES') -Directory |
Where-Object { $_.Name -like $compact -or $_.Name -like $wild } | ForEach-Object {
[xml]$f = Get-Content (Join-Path $_.FullName 'feature.xml') -Encoding UTF8
$wf = @(Get-ChildItem $_.FullName -Recurse -Filter '*.webpart' | Select-Object -First 1)
$type = $null
if ($wf) { [xml]$w = Get-Content $wf.FullName -Encoding UTF8
$n = @($w.SelectNodes('//*[local-name()="type"]')) | Select-Object -First 1
if ($n) { $type = $n.GetAttribute('name') } }
if (-not ($res | Where-Object { "$($_.FeatureId)" -eq "$($f.Feature.Id)" })) {
[void]$res.Add([PSCustomObject]@{ FeatureId = $f.Feature.Id; FeatureTitel = $f.Feature.Title; Scope = $f.Feature.Scope; Assembly = if ($type) { ($type -split ',')[1].Trim() } else { $null }; WebPartType = $type })
}
}
}
$res | Sort-Object FeatureTitel
}
# Example call:
Get-SPWebpartIds -Name "Event Manager"
# List all pages containing instances of the web part
Get-SPSite -Limit All | ForEach-Object {
$_.AllWebs | ForEach-Object {
$_.GetCatalogFiles() | Where-Object { $_.Name -match '\.(aspx|html)$' } | ForEach-Object {
$wf = $_.ParentWeb.GetFile($_.Name)
$wf.WebParts | Where-Object { $_.TypeName -match "AEEventManager" }
}
}
}
Step 3 – Remove web part instances from pages
For each affected page from step 2:
Through the UI: Page › Edit › click the web part › Remove › Publish the page
Through PowerShell (many pages): remove instances and check the page in/out and publish – we run this scripted.
- Through the UI: Page › Edit › click the web part › Remove › Publish the page
- Through PowerShell (many pages): remove instances and check the page in/out and publish – we run this scripted.
Step 4 – Deactivate the feature on all sites
Each web part ships with a site-scoped feature (feature ID per web part, e.g. 9c3401dc-fd86-4b2b-8800-c062655bde2f for the Event Manager). It is deactivated in every site collection – this also removes the gallery entry (_catalogs/wp) and the feature files:
# Check activations
Get-SPFeature -Site "https://intranet" | Where-Object { $_.Definition.Id -eq "9c3401dc-fd86-4b2b-8800-c062655bde2f" }
# Deactivate the feature in all webs
Get-SPSite -Limit All | ForEach-Object {
$_.AllWebs | ForEach-Object {
$f = $_.Features["9c3401dc-fd86-4b2b-8800-c062655bde2f"]
if ($f) { $f.Deactivate() }
}
}
Step 5 – Retract the farm solution (Uninstall / Retract)
The actual retraction of the solution. It automatically removes: the assembly from the GAC (all app servers), the SafeControl entry from every web.config, and the template files from the 15-Hive (_layouts/15/...). Afterwards the web application restarts automatically.
# Check status before retraction
Get-SPSolution | Where-Object { $_.Name -like "AEEventManager*" }
# Uninstall the solution farm-wide (Retract)
Uninstall-SPSolution -Identity "AEEventManager.wsp" -Confirm:$false
# Alternative via STSADM (older farms)
stsadm -o retractsolution -filename AEEventManager.wsp -immediate
# Confirm retraction completed (status: Uninstalled)
Get-SPSolution | Where-Object { $_.Name -like "AEEventManager*" }
# Then: delete the solution permanently from the farm catalog
Remove-SPSolution -Identity "AEEventManager.wsp" -Confirm:$false
# Verify: no AE solution left in the catalog
Get-SPSolution | Where-Object { $_.Name -like "AE*" }
Step 6 – Clean up configuration
Each web part may have a license and settings key in the web.config of the web application (e.g. AETI for Tiles, AEOC for Org Chart, farm-wide AEWB). Only the keys of the removed web part are deleted – on every app server. AEWB is kept as long as other AE web parts are still running. After a manual change, the web application is synchronized or the app pool is reloaded.
Step 7 – Verification and data cleanup
Finally we verify: solution no longer listed, feature not active anywhere, no instances on pages, no SafeControl entry left in the web.config, and no errors in the ULS logs.
Lists created by web parts (e.g. Event Manager lists) are not deleted by the uninstall – they remain and are only removed after explicit approval (with a prior export/backup of the contents).
Why not just retract the solution?
Retracting the solution handles part of the cleanup automatically – the assembly in the GAC, the SafeControl entry, and template files in the 15-Hive disappear on their own. But not everything:
Embedded instances show an error in the zone: The instances live in the page content (content database), not in the solution. Without the assembly, the page shows the message “Web Part Error … could not be found or it is not registered as safe” in the affected web part zone – the page itself still renders normally (verified on 24.08.2026 on our reference farm). We therefore remove the instances first (step 3) so that no error messages remain visible. The gallery entry is only the definition – deleting it does not affect any page.
Activated features remain stuck: The activation is stored in the content database; retraction only removes the feature definition. This leaves orphaned feature instances that are displayed incorrectly in the site collection settings.
Gallery files remain: The .webpart file in _catalogs/wp is a feature module file and is only removed by feature deactivation (step 4).
Risk with the shared file: AEWebpart.aspx is delivered by multiple solutions to the same path. SharePoint does not reference-count such files – retracting one solution physically deletes the file and can damage other, remaining AE web parts. Hence the planned order.
Lists and data remain (intentionally) but must be cleaned up manually in any case.
A “retract first” does not render the pages unusable – however, the error message in the zone remains visible until the instances are removed (step 3). For a production intranet we therefore recommend the order shown.
- Embedded instances show an error in the zone: The instances live in the page content (content database), not in the solution. Without the assembly, the page shows the message “Web Part Error … could not be found or it is not registered as safe” in the affected web part zone – the page itself still renders normally (verified on 24.08.2026 on our reference farm). We therefore remove the instances first (step 3) so that no error messages remain visible. The gallery entry is only the definition – deleting it does not affect any page.
- Activated features remain stuck: The activation is stored in the content database; retraction only removes the feature definition. This leaves orphaned feature instances that are displayed incorrectly in the site collection settings.
- Gallery files remain: The
.webpartfile in_catalogs/wpis a feature module file and is only removed by feature deactivation (step 4). - Risk with the shared file:
AEWebpart.aspxis delivered by multiple solutions to the same path. SharePoint does not reference-count such files – retracting one solution physically deletes the file and can damage other, remaining AE web parts. Hence the planned order. - Lists and data remain (intentionally) but must be cleaned up manually in any case.
AEWebpart.aspx). We plan the uninstall order accordingly so that remaining web parts keep working correctly.Rollback
If an uninstall needs to be reversed, the backup from step 1 is restored and the solution is redeployed:
# Re-add and deploy the solution
Add-SPSolution -LiteralPath "C:\wsp\AEEventManager.wsp"
Install-SPSolution -Identity "AEEventManager.wsp" -GACDeployment -Confirm:$false
# Alternative via STSADM
stsadm -o addsolution -filename AEEventManager.wsp
stsadm -o deploysolution -name AEEventManager.wsp -immediate -allowinsecurerequests
# Re-activate the feature in the webs
Enable-SPFeature -Identity "9c3401dc-fd86-4b2b-8800-c062655bde2f" -Url "https://intranet"