3

I am running PowerShell 2 on a Windows Server 2008 R2 Standard Server (German).

I want to use the SharePoint 2010 Management Console but am getting the following Errors:

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

and

Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime.

when calling get-spfarm.

I get the following when I try to identify the Version:

PowerShell Version

It uses the CLR Version 4.0.30319.1:

This seems to not be supported by SharePoint.

I than tried to run PowerShell as follows:

PowerShell.exe -Version 2.0

But somehow PoweShell still uses the CLR version 4.0.30319.1:

PowerShell Version

A lot of people on the internet have stated that they had this problem when the windows update KB2506143 was installed. This is not installed on my machine.

How can I force PowerShell to use the 2.0 Version of the .NET CRL?

Alexander
  • 420
  • 1
  • 5
  • 17

4 Answers4

2

Seems like the file on Server 2008 is Powershell.exe.activation_config. It's located at C:\Program Files(x86)\Common Files\NetApp.

Hope this helps!

0

Check out your powershell.exe.config file. Do you see the /configuration/startup/requiredRuntime XML element?

http://msdn.microsoft.com/en-us/library/a5dzwzc9(v=vs.110).aspx

  • I do not have a powershell.exe.config file. I have looked into the following two folders: C:\Windows\SysWOW64\WindowsPowerShell\v1.0 C:\Windows\System32\WindowsPowerShell\v1.0 – Alexander Jan 20 '14 at 15:10
  • Maybe you could create a fresh one, and just add the `requiredRuntime` element to it. I think the correct runtime version would be `v2.0.50727`. Look under the c:\windows\Microsoft.NET\Framework64 folder to be sure. –  Jan 20 '14 at 15:13
  • I have added the a powershell.exe.config to the following two folders: "C:\Windows\SysWOW64\WindowsPowerShell\v1.0" and "C:\Windows\System32\WindowsPowerShell\v1.0". The file looks like this: ` ` When I click on powershell.exe nothing has changed. Do I have to do something, so that the config file will be read? – Alexander Jan 20 '14 at 15:27
  • I believe it should be read when you start the application. Try adding the `supportedRuntime` element as well. http://msdn.microsoft.com/en-us/library/w4atty68(v=vs.110).aspx –  Jan 20 '14 at 15:34
  • I have now added the `supportedruntime`. The file now looks like this: ` ` There is still no change. – Alexander Jan 20 '14 at 15:38
  • Can you try restarting your computer after the change? That seems odd, that it wouldn't work. –  Jan 20 '14 at 16:17
  • I have now restarted the SharePoint Server. It still ignores everything. When I call $psversiontable it still mentions that version 4 of the CLR is used, although I have configured in the config file that it should only use version 2. – Alexander Jan 24 '14 at 10:56
0

Either undo any changes you made to your system that forced PowerShell or other .Net applications to use CLR 4. See here.

Or install .Net 3.5 (or 3.0 or 2.0), which will install CLR 2. If you run Windows 8 or 2012 you need do that by changing the Windows features. See here.

Community
  • 1
  • 1
Lars Truijens
  • 42,837
  • 6
  • 126
  • 143
0

We have now found a solution to the problem: We uninstalled the .NET Framework 4 (since we did not need this on the SharePoint Server). After this we could use the PowerShell for SharePoint again.

Alexander
  • 420
  • 1
  • 5
  • 17