3

I am trying to follow this tutorial to migrate SharePoint on premises to online. https://blogs.technet.microsoft.com/nishants/2015/07/18/using-windows-powershell-cmdlets-for-sharepoint-online-o365spo-migration/

I was provided with the access and was able to connect to the server with New-PSSession -ComputerName NameoftheComputer

But when i run the export-spweb command it gives me below error

export-spweb is not recognized as the name of a cmdlet.

The server is located on a different location but my PC is in the same domain. I do not have sharepoint installed in my PC hence Add-PSSnapin Microsoft.Sharepoint.Powershell is not working either.

I have tried the command Add-PSSnapin Microsoft.Sharepoint.Powershell

but it throws the below error "add-pssnapin microsoft.sharepoint.powershell is not installed on this computer"

2 Answers 2

1

In the above toturial, he is running command on the servers not remotely. You have to follow these steps,in order to run remote PowerShell.

On the Client Machine:

Log onto the client machine with the user(s) added in the SharePoint server above.

  1. Open Computer Management and select Services under Services and Applications. Set the Windows Remote Management (WS-Management) service to automatic and start the service.
  2. Open Windows PowerShell as Administrator
  3. Type Enable-WSManCredSSP -Role client -DelegateComputer “SharePointServerName”
    • Replace SharePointServerName with the FQDN of the SharePoint server
  4. Type $cred=get-Credential. Enter the credentials of the user logged onto the client machine
  5. Type $s=new-PSsession “SharePointServerName” -authentication credssp -credential $cred

    • Replace SharePointServerName with the FQDN of the SharePoint server
    • NOTE: If this fails with an "access denied" error, re-run Step 10 on the server to enable configuration of the x64 PowerShell by runningSet-PSSessionConfiguration -Name Microsoft.PowerShell32 –ShowSecurityDescriptorUI
  6. Type Invoke-Command -Session $s -ScriptBlock {Add-PSSnapin Microsoft.SharePoint.PowerShell;}

  7. Type Invoke-Command -Session $s -ScriptBlock {get-SPContentDatabase}This will return all the content databases in your SharePoint farm and ensure you have access

  8. Type Invoke-Command -Session $s -ScriptBlock {get-spserviceinstance}This will return the SharePoint service instances and ensure you have access

Please read this msdn blogs for complete steps. How to enable Remote PowerShell for SharePoint 2013 for Non-Administrators

4
  • it failed on no:5 but not with access denied error but "the authentication mechanism requested by the client is not supported by the server or unencrypted traffic is disabled in the service configuration " any idea why ?
    – Rinu
    Dec 24, 2017 at 8:17
  • Check this community.spiceworks.com/topic/…
    – Waqas Sarwar MVP
    Dec 24, 2017 at 8:30
  • I was able to get around this issue with some server side changes but still i am unable to run the export-spweb command . It throws error "export-spweb is not recognized as the name of a cmdlet."
    – Rinu
    Dec 24, 2017 at 11:34
  • Could you please share ur command? Did you run this Invoke-Command -Session $s -ScriptBlock {Add-PSSnapin Microsoft.SharePoint.PowerShell;}
    – Waqas Sarwar MVP
    Dec 24, 2017 at 15:22
0

SharePoint Server is a 64bit program you need to open 64bit version of PowerShell ISE.

Verify if you are using 32bit/x86 version . if you are using X86 version , please change it to 64-bit version .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.