none
how to use sharepoint 2010 management shell

    Question

  • hello,

    This might be a simple question but i am new so please help me...i wanted to restore a site and when i typed in the command Restore -SPSite - identity "http://test" -path "c:\test.bak" - force i got an error that the term restore is not recognized as the name of a cmdlet....can someone please tell me how do i configure this.

     

    Thanks

    • Moved by Mike Walsh FIN Thursday, November 18, 2010 3:56 AM SP 2010 q so please use a SP 2010 forum for it (From:SharePoint - Setup, Upgrade, Administration and Operation (pre-SharePoint 2010))
    Thursday, November 18, 2010 12:47 AM

Answers

  • Steve,

    It looks like you are using the Windows PowerShell instead of the SharePoint 2010 Management Shell would suggest you to run the CMDLet from the SharePoint 2010 Management Shell from the server where SharePoint 2010 is installed. You can even use the Windows PowerShell for using the SharePoint 2010 CMDLets. To do the same first you will have to load the SharePoint PSSnapin using the following CMDLet

     

    Add-PsSnapin Microsoft.SharePoint.PowerShell
    

    Followed by restoring your site using the following CMDLet

    Restore-SPSite -Identity http://server_name/sites/site_name -Path C:\Backup\site_name.bak
    
    You can also check the following link for more info on Restore-SPSite

     

    Hope that helps.

    -Mukesh


    "Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread."
    • Marked as answer by Sharepoint99 Friday, November 19, 2010 3:55 PM
    Thursday, November 18, 2010 8:11 AM

All replies

  • Try Restore-SPSite http://test -Path "c:\Test.bak"

    For more info on powershell commandlet reference have a look here http://technet.microsoft.com/en-us/library/ee890108.aspx


    Microsoft Certified Master | SharePoint 2007
    Blog
    Thursday, November 18, 2010 6:00 AM
  • how did you backup the site?

    If this is not a site collection then you cannot use restore-spsite. type in get-help restore-spsite and it will tell you what you can use the cmdlet for.

    In your case you need import-spweb so use get-help import-spweb to do that...


    Alpesh Nakar's Blog Alpesh Just SharePoint Just SharePoint Updates

    SharePoint Saturday India Online Nov 20 2010 Contributing Author SharePoint 2010 Unleashed

    MCTS: SharePoint 2010 Configuration MCITP: SharePoint 2010 Administrator

    Thursday, November 18, 2010 6:02 AM
  • Steve,

    It looks like you are using the Windows PowerShell instead of the SharePoint 2010 Management Shell would suggest you to run the CMDLet from the SharePoint 2010 Management Shell from the server where SharePoint 2010 is installed. You can even use the Windows PowerShell for using the SharePoint 2010 CMDLets. To do the same first you will have to load the SharePoint PSSnapin using the following CMDLet

     

    Add-PsSnapin Microsoft.SharePoint.PowerShell
    

    Followed by restoring your site using the following CMDLet

    Restore-SPSite -Identity http://server_name/sites/site_name -Path C:\Backup\site_name.bak
    
    You can also check the following link for more info on Restore-SPSite

     

    Hope that helps.

    -Mukesh


    "Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread."
    • Marked as answer by Sharepoint99 Friday, November 19, 2010 3:55 PM
    Thursday, November 18, 2010 8:11 AM
  • Alpesh: It is a site collection backup that i took from the central administration.

    Mukesh:I am using the sharepoint 2010 management shell 

    this is what i am typing exactly 

    PS C:\>Restore-SPSite -Identity http://test/test -Path C:\Backup\test.bak.

    I also tried to use the command Add-PsSnapin Microsoft.SharePoint.PowerShell but it said that it cannot add because it is already added....

    The only problem is that it is not recognizing the restore command am i typing something wrong or do i have to go to a certain directory to make this comman working

     

    Thanks

    Thursday, November 18, 2010 1:47 PM
  • What is this http://test/test ?

    If you are trying to restore a site collection in a web http://test/ and if it's under a managed path [that is not root site collection] you should be doing something like http://test/sites/test


    Alpesh Nakar's Blog Alpesh Just SharePoint Just SharePoint Updates

    SharePoint Saturday India Online Nov 20 2010 Contributing Author SharePoint 2010 Unleashed

    MCTS: SharePoint 2010 Configuration MCITP: SharePoint 2010 Administrator

    Friday, November 19, 2010 5:24 AM