Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SP2013 Manag.PowerShell Problem:  Cannot load Windows PowerShell snap-in Microsoft.SharePoint.PowerShell because of the following error: Could not load file or assembly

Posted on 2013-12-13
5
Medium Priority
?
3,687 Views
Last Modified: 2013-12-13
Hello,

I can't start the SharePoint 2013 Management Shell, if I click on the link, it returns the following:

May someone help me with this ?



Add-PsSnapin : Cannot load Windows PowerShell snap-in Microsoft.SharePoint.PowerShell because of the following error: Could not load file or assembly
'file:///C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.SharePoint.PowerShell\v4.0_15.0.0.0__71E9BCE111E9429C\Microsoft.SharePoint.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
At C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\SharePoint.ps1:3 char:13
+ Add-PsSnapin <<<<  Microsoft.SharePoint.PowerShell
    + CategoryInfo          : InvalidArgument: (Microsoft.SharePoint.PowerShell:String) [Add-PSSnapin], PSSnapInException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Open in new window

0
Comment
Question by:Sa5cha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 2000 total points
ID: 39716241
Hi,
seems that you are using the wrong Powershell version.

What happens if you open a Powershell window (not the SharePoint Management Shell) and you enter:
$host.Version

Open in new window

Does this return 3.0?
If not please install Powershell V3.

If this does return V3, then run the same command in SharePoint Management shell.
If this returns V2, check the shortcut to the SharePoint Management shell if it contains a command line swith "-version" and if this one is set to v2 change it to v3.

HTH
Rainer
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39716252
And if the above does not help, you might try the steps mentioned in this blog post:
http://oztripwire.blogspot.de/2013/04/sharepoint-2013-powershell-woes-and.html

HTH
Rainer
0
 

Author Comment

by:Sa5cha
ID: 39716471
Hi Rainer,

good hint on the sp2013 where the sps ps isnt workings its:

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1

the sp2013 farm where its working its

Major  Minor  Build  Revision
-----  -----  -----  --------
3     0      -1     -1

Ill try to switch and give you a feedback

Sascha
0
 

Author Comment

by:Sa5cha
ID: 39716495
System where SP2013 PS showing the error:

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -Version 2 -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\\sharepoint.ps1

Changed the Version from 2 to 3:

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -Version 3 -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "

Result: SPS PS now starting with out an error.

Thank you Rainer
0
 

Author Comment

by:Sa5cha
ID: 39716504
I've requested that this question be closed as follows:

Accepted answer: 500 points for RainerJ's comment #a39716241
Assisted answer: 0 points for Sa5cha's comment #a39716495

for the following reason:

It solved the problem now, SPS PS now starting in Version 3 without errors. Thank you rainer.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question