This article describes the steps required to remove EntraCP from your SharePoint farm.
Unfortunately, the only supported way to clear the property ClaimProviderName is to remove and recreate the SPTrustedIdentityTokenIssuer object. Alternatively, this property can be reset using .NET reflection, but this is not supported and you do this at your own risks:
Run the following script on the server running the central administration, to completely uninstall EntraCP from the SharePoint farm:
<#
. SYNOPSIS
Uninstalls "EntraCP.wsp" in a simple, automated way
. DESCRIPTION
Run this script ONLY on the server running the central administration, in a new PowerShell process.
The script does not require any modification.
. LINK
https://entracp.yvand.net/docs/usage/remove/
#>
$product = "EntraCP"
$featureNamePrefix = "Yvand"
Write-Host "Disables the features present in $product .wsp solution"
Disable-SPFeature -Identity " $featureNamePrefix . $product " -Confirm: $false # This will remove the claims provider from the farm
Disable-SPFeature -Identity " $featureNamePrefix . $product .Administration" -Url $ ([ Microsoft.SharePoint.Administration.SPAdministrationWebApplication ]:: Local . Url ) -Confirm: $false
Write-Host "Uninstalls the features present in $product .wsp solution"
Uninstall-SPFeature -Identity " $featureNamePrefix . $product " -Confirm: $false
Uninstall-SPFeature -Identity " $featureNamePrefix . $product .Administration" -Confirm: $false
# Sanity check: The solution should not be retracted until its features are properly removed, because it cannot be done afterward
if ( $null -eq ( Get-SPFeature | ?{ $_ . DisplayName -like " $featureNamePrefix . $product *" }) -and
$null -eq ( Get-SPClaimProvider -Identity " $product " -ErrorAction SilentlyContinue )) {
Write-Host "Retracts the $product .wsp solution"
Uninstall-SPSolution -Identity " $product .wsp" -Confirm: $false
$count = 0
$maxAttempts = 10
do
{
Write-Host "Waiting for the solution $product .wsp to be retracted..."
Start-Sleep -Seconds 10
$solution = Get-SPSolution -Identity " $product .wsp"
$count ++
}
while ( $count -lt $maxAttempts -and $false -ne $solution . Deployed -and $false -ne $solution . JobExists )
if ( $false -eq $solution . Deployed -and $false -eq $solution . JobExists ) {
Write-Host "Removes the $product .wsp solution"
Remove-SPSolution -Identity " $product .wsp" -Confirm: $false
}
}
This script does the minimum work required in PowerShell, before you can safely retract the solution from the central administration.
Run the following script on the server running the central administration:
# Disables the features present in EntraCP.wsp solution
Disable-SPFeature -Identity "Yvand.EntraCP" # This will remove the claims provider from the farm
Disable-SPFeature -Identity "Yvand.EntraCP.Administration" -Url $ ([ Microsoft.SharePoint.Administration.SPAdministrationWebApplication ]:: Local . Url )
# Uninstalls the features present in EntraCP.wsp solution
Uninstall-SPFeature -Identity "Yvand.EntraCP"
Uninstall-SPFeature -Identity "Yvand.EntraCP.Administration"
# Sanity check
if ( $null -eq ( Get-SPFeature | ?{ $_ . DisplayName -like "Yvand.EntraCP*" }) -and
$null -eq ( Get-SPClaimProvider -Identity "EntraCP" -ErrorAction SilentlyContinue )) {
Write-Host "You can now safely retract EntraCP.wsp"
} else {
Write-Warning "You should not retract EntraCP.wsp until all its features and its claims provider are properly removed. You won't be able to do it after you retracted the solution, unless you redeploy the solution"
}
Browse to the central administration > System Settings > Manage farm solutions > EntraCP.wsp > Retract Solution
Once the solution is retracted, click again on EntraCP.wsp > Remove Solution