Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, September 10, 2013 6:58 PM
Fresh install of SharePoint 2010 Enterprise. I am trying to restore a site collection done by our hosted sharepoint provider. That's doesn't work giving me a ridiculously retarded error message that covers so many issues, I have no idea what is causing the restore to fail.
As of yet none of the blogs, forum posts, or other sites have been helpful. A bunch of them mention to make sure current site collections are actually deleted since Central Administration doesn't just plain delete site collections as expected. I figured I would go that route. In SharePoint 2010 Management Console I type "Get-SPDeletedSite". Instead of the command working, I get the following:
The term 'Get-SPDeletedSite' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, werify that the path is correct and try again.
I'm getting the same error message on a number of commands that every page I find says should be working, yet there's no pages on how to solve this problem. I tried the following without success:
Search - if I found a solution, I wouldn't be posting this.
Use SharePoint 2010 Management Shell - Doesn't help, I am already using this shell.
Use Powershell and load Add-PSSnapin "Microsoft.SharePoint.PowerShell" - doesn't work, I get the same error message when running sharepoint commands.
Any ideas on how to solve this problem?
All replies (8)
Tuesday, September 10, 2013 9:04 PM ✅Answered
There's three main reasons why Get-SPDeletedSite might not work:
1) The SharePoint Snapin is not loaded. If you run PowerShell then this isn't loaded by default, you need to run the 'Add-PSSnapin Microsoft.SharePoint.PowerShell' cmdlet. This is not going to be valid if you're using the SharePoint management shell but it's included for completeness.
2) You don't have permissions. If you run 'Get-SPFarm' you should get some sort of result, if you don't have the right permissions you'll get a message similar to 'The farm is not available'. This happens if you're not part of the SP-ShellAdmins group, farm admins DO NOT get this by default, your install account and your farm account both are members (if i remember correctly). If you have the permissions you should be able to do things like 'Get-SPWebApplication' and get a list of web applications back.
3) Not using SharePoint SP1. The Get-SPDeletedSite cmdlet only appeared as part of SP1, before that it didn't exist and so, obviously wouldn't be part of the available commands. This would make sense if some cmdlets don't work but most, like Get-SPSite, Get-SPFarm etc. work but those reffering to Get-SPDeletedSite do not.
Is that of any help, can you close down the options by confirming the behaviour for Get-SPFarm etc.?
Tuesday, September 10, 2013 7:44 PM
What operating system did you install SharePoint 2010 on? Are you running the Management Shell "As Administrator"?
Trevor Seward, MCC
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
Tuesday, September 10, 2013 8:00 PM
Thanks for your reply.
**What operating system did you install SharePoint 2010 on? **
Windows Server 2008 R2
Are you running the Management Shell "As Administrator"?
Small detail I forgot in my frustration. Yes I am. Even ran Power Shell as administrator.
Tuesday, September 10, 2013 8:11 PM
What version of powershell do you have, 2 or 3? Its a pretty tough pill to swallow that you have a vanilla SP2010 / Server 2008 R2 install and the SP PS cmdlets aren't loading.
how about running Get-Module inside of the command shell, as well as Get-Module –ListAvailable
Please mark my response as an answer if appropriate.
Learn.SharePoint.com
Tuesday, September 10, 2013 8:39 PM
What version of powershell do you have, 2 or 3? Its a pretty tough pill to swallow that you have a vanilla SP2010 / Server 2008 R2 install and the SP PS cmdlets aren't loading.
how about running Get-Module inside of the command shell, as well as Get-Module –ListAvailable
I agree, but I am experiencing the problem anyway.
Powershell Version: 2
Get-Module: Nothing is shown.
Get-Module –ListAvailable: I get a list of 10 modules: ADRMS, AppLocker, BestPractices, BitsTransfer, PSDiagnostics, ServerManager, TroubleshootingPack, WebAdministration, SQLASCMDLETS, SQLPS
Tuesday, September 10, 2013 8:42 PM
SharePoint won't show as a module. Does the Add-PSSnapin work without error?
Trevor Seward, MCC
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
Wednesday, September 11, 2013 8:07 AM
If the options provided by Alex doesn't work then you can go to registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell) and check for the permissions for Users group if the full control is not provided do assign the full control this setting has worked for me.
#RoHsTr
Wednesday, September 11, 2013 2:55 PM
Alex is right. SP1 had to be installed, but instead I installed SP2. I ran Microsoft update right after installing SharePoint, guess Microsoft doesn't push SharePoint updates through update.
Thanks fro the help.