Remove the Provider

Oct 23, 2012 at 3:32 PM

Hi All,

a little question.. after that the provider is installed I did the following powershell commands

$trust = Get-SPTrustedIdentityTokenIssuer "TRUSTEDLOGINPROVIDER NAME"
$trust.ClaimProviderName = "LDAPClaimProvider"
$trust.Update()

Which are the command to reverse it back to the standard one?

Thanks!

Coordinator
Oct 25, 2012 at 3:37 PM

hello,

unfortunately SharePoint API provides no easy way to remove a claim provider once it has been assigned to a trust.

The only way is to remove the trust and recreate it, which is fortunately very fast if you create it from a PowerShell script.

 

Oct 26, 2012 at 8:50 AM

There is a way.

I found the way to remove the provider... :)

$provider = Get-SPTrustedIdentityTokenIssuer “Name of the toker issuer"

$provider.GetType().GetField("m_ClaimProviderName","NonPublic,Instance").SetValue($provider, $null)

$provider.Update()

Coordinator
Oct 29, 2012 at 12:53 PM

I tested it and it works very well.

But you are doing reflection and you bypass SharePoint API,  which is unfortunately not supported despite I didn't notice any side effect and it looks safe.