Implicit Remoting for SharePoint 2013

Welcome Forums General PowerShell Q&A Implicit Remoting for SharePoint 2013

This topic contains 2 replies, has 3 voices, and was last updated by

 
Participant
1 week ago.

  • Author
    Posts
  • #113837

    Participant
    Points: 0
    Rank: Member

    I need to be able to use implicit remoting to a SharePoint 2013 server.    Using the information in the article below I have set it up and am trying to import the session, but am getting the following error:

    import-pssession: Running the get-Command command in a remote session returned no results.

    Not sure if it makes a difference, but the psversion on the server is 3 and the psversion on the client machine is 5.

    https://www.globalknowledge.com/blog/2015/12/02/how-to-manage-powershell-remote-access-with-sharepoint-server-2013/

    Any suggestions are welcome

     

  • #113957

    Keymaster
    Points: 1
    Rank: Member

    That's a known problem with SP2013. Implicit Remoting doesn't work with it very well. There are authentication problems, as well as what you're running into. "Don't use SP2013" is the most common answer I see. I mean... it is pushing 6 years old.

  • #113978

    Participant
    Points: 10
    Rank: Member

    Yep on get off SP2K13, but we know how many enterprises are, meaning slow to move for whatever the reason. I still have to deal with this at many customers I get called to engage with. Legacy everything, but they want to do all this new stuff. Argh!!!

    You do not say how you PSRemoting environment is setup. SP requires extra steps to do this.

    Understand the security ramifications of some remote session types, and specifically SharePoint.

    Accidental Sabotage: Beware of CredSSP


    https://blogs.technet.microsoft.com/heyscriptingguy/2012/11/14/enable-powershell-second-hop-functionality-with-credssp
    https://msdn.microsoft.com/en-us/library/ee309365(v=vs.85).aspx

    PowerShell Remoting for SharePoint

    MS TechNet has had this documented for over 4 years now.

    How to enable Remote PowerShell for SharePoint 2013 for Non-Administrators
    https://blogs.technet.microsoft.com/anneste/2014/09/17/how-to-enable-remote-powershell-for-sharepoint-2013-for-non-administrators

    See also:

    PowerShell Remoting to a SharePoint Server with PowerShell v3 Installed

    Once you get all setup as required...
    (In all my use cases to date, I just had to do this – the below has not worked in all scenarios)

    # On the SharePoint Server
    Enable-PSRemoting -Force Enable-WSManCredSSP -Role Server -Force
    Enable-WSManCredSSP -Role Server -Force
    
    
    # On your management 
    # Client (this has to be done once per unique managment client)
    Enable-WSManCredSSP -Role Client -DelegateComputer * -Force
    Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentials -Name WSMan -Value WSMAN/*
    Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsDomain -Name WSMan -Value WSMAN/*
    

    you should be able to do this. Well, I have, and it's worked in my use cases as needed.

    SharePointSession = New-PSSession -ComputerName SharePointServerFqdn `
    -Authentication Credssp -Credential ResourceAdministrator
    Invoke-Command -Session SharePointSession `
    -scriptblock {Add-PsSnapin Microsoft.SharePoint.PowerShell}
    Import-PSSession SharePointSession
    

You must be logged in to reply to this topic.