Turn remoting into local execution RRS feed

  • السؤال

  • Hi,

    I tried searching the forums for something similar but couldn't find any thread related to this.

    I want to turn remoting (Invoke-Command) inte local execution on a server.

    So, for example, I have:

    Invoke-Command -computername XXX -scriptblock { F:\Setup.exe }

    (first i copy the ISO file to the computer XXX and then mount it to F:)

    The problem I have is that the setup.exe in turn does some hopping in a windows environment which leads to double-hop issues.

    Thus, I want to make the execution of "F:\Setup.exe" to happen on computer XXX, not from my management server with the Invoke-Command.

    Is there any other way of doing this other than creating a scheduled task on XXX saying it should run the command "F:\Setup.exe" ?


    28/جمادى الأولى/1441 09:39 ص

جميع الردود

  • Hi,

    Question: the setup "ask" to be run from a "master" to run command on a target. Am I right ?

    If so, from what you wrote, even if you make some scheduled task, you will still be blocked with the double-hop issue (which is not an issue, but a security). The only correct way for you is to use the CredSSP provider on the master. You will be able to delegate credential for other systems.

    The key of learning is practice.

    28/جمادى الأولى/1441 03:34 م
  • Hi,

    To dig more into the setup.exe it is a simple SQL installation. When we provide domain accounts in the configuration.ini then it seems that a check into active directory is made and sometimes we get an error like "xxxxx is not trusted for delegation".

    We have tried to turn on delegation on the machine account and the account that runs the script. SPN's are created and so on. But I can't replicate the error so then I thought of this solution. Try to run setup.exe "locally" and get rid of this problem entirely.


    02/جمادى الثانية/1441 11:39 ص
  • Hi,

    The setup is from Microsoft SQL Server ISO file ?

    The key of learning is practice.

    02/جمادى الثانية/1441 11:46 ص
  • Yes, we mount the iso and then run X:\Setup.exe
    02/جمادى الثانية/1441 12:06 م
  • Why don't you just click on it ? Or open cmd line and run the setup ?

    The key of learning is practice.

    02/جمادى الثانية/1441 07:20 م
  • That process is part of an automated installation using powershell. There are several more steps to be done, also with the help of powershell, after setup.exe is run.

    Also, the question is more general. What are the alternatives to invoke-command? 

    In a powershell forum, I wasn't expecting the answer to be to just double click exe-files.

    03/جمادى الثانية/1441 07:48 ص
  • Just run the exe to get it to install.  There is no need to use Invoke-Command to do a local install.

    For issues wil SQLServer installs please post in the SQLServer deployment forum.  They will help you understand how to use the SQS installer.


    03/جمادى الثانية/1441 09:39 ص
  • Hi,

    First, you should try to learn a little more about PowerShell. The Invoke-Command is, by design, dedicated to start commands remotely. So, you are wrong from the start.

    Second, you said : "I wasn't expecting the answer to be to just double click exe-files". It is the more appropriate way from the context you gave us. You never told anything about the reason you want to run it by the cmd line, which is maybe the main thing we have to know to help you.

    Third, to run an exe file, you don't need PowerShell. You can, sure, but if your request is more "general", you can still run it from the command prompt. In PowerShell you can do :

    & F:\Setup.exe or Start-Process -FilePath F:\Setup.exe
    Remark : I don't give you any parameters because I don't remember these. But if you do these command you still be stuck on the UI by default.

    The key of learning is practice.

    • تم التحرير بواسطة arnaud.helin 03/جمادى الثانية/1441 10:45 ص
    03/جمادى الثانية/1441 10:44 ص
  • To save everyones time.

    If there is a moderator watching this. You can safely erase this thread.

    • تم وضع علامة كإجابة بواسطة Daniel Mercourios 03/جمادى الثانية/1441 12:30 م
    • تم إلغاء علامة كإجابة بواسطة jrvModerator 03/جمادى الثانية/1441 02:54 م
    03/جمادى الثانية/1441 12:30 م
  • It should be great if you shared your solution for others who would see the thread.

    The key of learning is practice.

    03/جمادى الثانية/1441 12:54 م
  • ****** It should be great if you shared your solution for others who would see the thread. *******


    03/جمادى الثانية/1441 02:56 م
  • I have no solution.

    I will try my own theory.

    From a management server I will create a scheduled task on the remote server where it is executing a .ps1-file.

    In that way I bypass the delegation problem.

    04/جمادى الثانية/1441 12:27 م