none
PowerShell Remoting access denied with sharepoint commands

    Question

  • Hello

          I am executing commands with powershell remoting.

          In the first environment i have all in the same machine, sharepoint & Sql Server. When i access from other machine with powershell remoting all works fine.

          In the second environment i have two machines, front with sharepoint and back machine with sql server. In this machine the commdands like get-spsite fails with the message that i don´t have permisions.

          in both environments i put the same configuration.

                  The user of the remote machine as administrator of the sharepoint machines.

                  The user of the remote machine as Farm administrator.

                  The user of the remote machine as db_owner and shell_access on the sharepoint config database.

                  Both envioronments with remote powershell enabled

        I think that i have done a restart of the machine of the first environment, before all works fine, but before do the restart of the two machines of the second environment, i would like to know if the restart can be the solution or if exist some diference between have one or two machines.

     

       i think that when i use a command like get-spsite or other, i only access the front machine of sharepoint and sharepoint access the machine of sql server. other option if i need the use of the things that Ravikanth Chaganti comments in the article:

    http://www.ravichaganti.com/blog/?p=1230

    PowerShell 2.0 remoting guide: Part 12 – Using CredSSP for multi-hop authentication

        But i think that when i access the sharepoint front server with powershell remoting from other machine, the connection with the sql server is always made by sharepoint.

    thanks

    • Edited by JavierVGo Tuesday, May 7, 2013 3:19 PM
    Tuesday, May 7, 2013 3:12 PM

Answers

  • Finally the problem it´s that the two machines of the environment.

    in this case it´s necessary the use of Multi-Hop described by Microsoft here

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee309365%28v=vs.85%29.aspx

    • Marked as answer by JavierVGo Wednesday, May 8, 2013 9:38 AM
    Wednesday, May 8, 2013 9:38 AM

All replies

  • Hi Javier,

    Can you try once by giving full control to everyone (for time being) on the folder from where you are executing the script. Otherwise try after doing a iisreset/system restart.

    Regards  Roy Joyson
    Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.


    Roy Joyson

    Tuesday, May 7, 2013 3:20 PM
  • Hello Roy

         I answer you, and give more information.

         I am deploying with TFS and i am doing this steps in the environments,

              1.- Compile and build-->0k

              2.- Copy the drop files (.wsp and scripts) to the folder of the sharepoint server.-->ok

              3.- Run the scripts--> no ok

          The folder of the sharepoint server is shared (Read/Write) for the TFS_Build Account.

           i have done other test, like i have wrote in the question (connect via powershell console with the TFS_Build account and execute a simple command like Get-SpSite)

          then... the folder it´s not a problem

          The second environment it´s in hand of the Administrators Group of my client, and before i ask for a restart, i want to know if exist other problem with two machines and i need something like multi-hop authentication.

         Really i think that restarting will fix the problem, because i can remember something similar in the environment with one machine. i think that i had to restart the machine before all works fine.

       






    • Edited by JavierVGo Tuesday, May 7, 2013 3:37 PM
    Tuesday, May 7, 2013 3:33 PM
  • Finally the problem it´s that the two machines of the environment.

    in this case it´s necessary the use of Multi-Hop described by Microsoft here

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee309365%28v=vs.85%29.aspx

    • Marked as answer by JavierVGo Wednesday, May 8, 2013 9:38 AM
    Wednesday, May 8, 2013 9:38 AM
  • Hi Javier,

    I am having similar issue with Sharepoint command, but in mycase its with the 'Microsoft.SharePoint.Publishing'.

    When I am importing the deleting, re-creating sites, and wsp's. It works fine, but when I try to publish navigation menu, pages, etc I get Access denied.

    I followed the above link you mentioned but I didnt understand the HTTP listenr step. Would that have anythging to do with the issue?

    I have posted on StackOverFlow as well 

    http://stackoverflow.com/questions/17335354/remote-powershell-access-denied-for-certain-dlls-execution-for-sharepoint-2013/17336202?noredirect=1#17336202

    Thanks

    Thursday, June 27, 2013 8:48 AM