Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just installed the .NET Framework 4.0 and WMF 3.0 on a Server 2008 R2 SP1 machine that has SharePoint Foundation 2010 installed on it.

Now, when I go to Start - All Programs - Microsoft SharePoint 2010 Products - SharePoint 2010 Management Shell (run as administrator) I get the following error: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

If I type: add-PSSnapin Microsoft.SharePoint.PowerShell then Get-SPFarm, I get the following:

Get-SPFarm : Microsoft SharePoint is not supported with version 4.0.30319.1 of
the Microsoft .Net Runtime.
At line:1 char:1
+ Get-SPFarm
+ ~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...SpCmdletGetFarm:
   SpCmdletGetFarm) [Get-SPFarm], PlatformNotSupportedException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetFarm

It seems that after installing WMF 3.0, now Powershell is configured to run against .NET Framework 4.0. I am fine with that, but I need to be able to open at least one Powershell session against .NET 3.5 so that I can work with the SharePoint API.

Thanks,

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Why did you install it? Sharepoint 2010 is a .NET 3.5 app and not supported for use with .NET 4.0 like Sharepoint 2013 is, same for Powershell 3.0.

Regardless, you can fix this by running the shell in PS 2.0 mode. This helps if you are messing around with Sharepoint 2010 on a Windows 2012 server for instance.

in Powershell:

Powershell -version 2

Add-PSSnapin Microsoft.SharePoint.PowerShell

That should get you what you are after.

share|improve this answer
    
I installed it so I can manage this server from the new Server Manager available in Server 2012/Windows 8. Thanks, your answer worked. –  GemCer Nov 28 '12 at 15:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.