Exact TechNet PowerShell example is not working

Hi,

I am trying to run the exact example in the following TechNet article and I am getting error:

http://technet.microsoft.com/en-us/library/ff607629.aspx


Command: (please note that no matter I user correct or wrong Identity name, I get the same error)

Get-SPClaimProvider -Identity "MyClaimProvider" | Set-SPClaimProvider -Enabled $false

Error:

Set-SPClaimProvider : Cannot bind parameter 'Identity'. Cannot convert value "False" to type "Microsoft.SharePoint.PowerShell.SPClaimProviderPipeBind". Error: "Invalid cast from 'System.Boolean' to
'Microsoft.SharePoint.PowerShell.SPClaimProviderPipeBind'."
At C:\ADFS\Untitled1.ps1:4 char:80
+ Get-SPClaimProvider -Identity "MyClaimProvider" | Set-SPClaimProvider -Enabled $ ...
+                                                                                ~
    + CategoryInfo          : InvalidArgument: (:) [Set-SPClaimProvider], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.SharePoint.PowerShell.SPCmdletSetSPClaimProvider


I get the similar type of error with other examples too.

What is the concept that I am missing?

Thank you,





February 28th, 2014 10:54am

Not all TechNet examples are correct. I'd encourage you to leave feedback on articles that are incorrect so they get fixed.
Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 11:19am

Hi Allan48,

I think it is not able to find your provider. Make sure that the mentioned provider does exist.

Please try this below command first, which will enlist all the providers available.

Get-SPClaimProvider

If you don't see your provider in the list then that's the issue.

Regards,

Tapan

February 28th, 2014 12:13pm

Hi Tapan,

No mater the provider name is correct or not, the command returns the same error.

Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 12:22pm

did you try to without "$" 

Get-SPClaimProvider -Identity "MyClaimProvider" | Set-SPClaimProvider -Enabled false

or

Get-SPClaimProvider -Identity "MyClaimProvider" | Set-SPClaimProvider -Enabled "false"

February 28th, 2014 12:35pm

Hmm very strange.

One more thing you should try is Type command instead of copy-paste.

Regards,

Tapan

Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 12:49pm

Are you running powershell as Administrator?
February 28th, 2014 2:19pm

Yes, I run PS as admin.
Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 2:37pm

Have you tried IsEnabled = $false

instead of just Enabled = $false

?

Property seems it should be "IsEnabled" instead of "Enabled"

February 28th, 2014 4:37pm

Hi Allan,

If you run this cmdlet Get-SPClaimProvider -Identity "MyClaimProvider" what is the output you are getting.

Free Windows Admin Tool Kit Click here and download it now
February 28th, 2014 6:36pm

I get the SPClaimProvider object. I think the problem is that there is no way to disable a SPClaimProvider. As Trevor mentioned, the command is no correct. Perhaps the -Enabled option is wrong.

I do hope that I am wrong.

February 28th, 2014 8:53pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics