Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
Restore-SPSite -Identity http:/snk145:60000/ -Path "D:/MS.bak"

I am trying to restore a site collection (SharePoint 2010) to other from a backup file,

The term 'Restore-SPSite' 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, verify that the path is correct and try again.
At line:1 char:15
+ Restore-SPSite <<<<  -Identity http:/snk145:60000/ -Path "D:/MS.bak"
    + CategoryInfo          : ObjectNotFound: (Restore-SPSite:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

What Should I do?

UPDATE

As Alex said, got the command worked, however getting another error as follows

Restore-SPSite -Identity http:/snk145:60000/ -Path "D:/MS.bak"

Confirm
Are you sure you want to perform this action?
Performing operation "Restore-SPSite" on Target "http:/son1834:60000/".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):


Restore-SPSite : Invalid URI: The Authority/Host could not be parsed.
At line:1 char:15
+ Restore-SPSite <<<<  -Identity http:/snk145:60000/ -Path "D:/MS.bak"
    + CategoryInfo          : InvalidData: (Microsoft.Share...dletRestoreSite:SPCmdletRestoreSite) [Restore-SPSite], U
   riFormatException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite

What next?

share|improve this question
    
Is it because of the forward slash? Replace it with backslash in the path -'D:\MS.bak' and retry. –  Deepu Nair Nov 21 '11 at 12:04
    
No deepu it was a problem that Alex suggested, please look at the question for another error –  Jithu Nov 21 '11 at 12:17
1  
Try to use double slash -Identity http:**//**snk145:60000/ –  Alexander Nov 21 '11 at 12:26
1  
Hi Jithu - check this post detailing how powershell scripts are executed - social.technet.microsoft.com/Forums/pl-PL/sharepoint2010setup/… –  Deepu Nair Nov 21 '11 at 12:27
    
Thank you Deepu for the link!! Definitely I can avoid some future errors !! –  Jithu Nov 21 '11 at 12:31
add comment

2 Answers

up vote 2 down vote accepted

Use Add-PsSnapin Microsoft.SharePoint.PowerShell command before your script.

share|improve this answer
    
Hi Alex That did the trick however now I am getting another error I will update the question to include it !! –  Jithu Nov 21 '11 at 12:17
    
Got it - http:// –  Jithu Nov 21 '11 at 12:24
add comment

Check whether you are using the Windows PowerShell instead of the SharePoint 2010 Management Shell. I would suggest you to run the CMDLet from the SharePoint 2010 Management Shell from the server where SharePoint 2010 is installed.

Check also the path you have entered - 'D:/MS.bak' . Shouldn't that be 'D:\MS.bak' with a backslash?

share|improve this answer
add comment

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.