none
Turn remoting into local execution RRS feed

  • Frage

  • 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" ?

    /Daniel

    Donnerstag, 23. Januar 2020 09:39

Alle Antworten

  • 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.

    Donnerstag, 23. Januar 2020 15: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.

    /Daniel

    Montag, 27. Januar 2020 11:39
  • Hi,

    The setup is from Microsoft SQL Server ISO file ?


    The key of learning is practice.

    Montag, 27. Januar 2020 11:46
  • Yes, we mount the iso and then run X:\Setup.exe
    Montag, 27. Januar 2020 12:06
  • Why don't you just click on it ? Or open cmd line and run the setup ?

    The key of learning is practice.

    Montag, 27. Januar 2020 19: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.

    Dienstag, 28. Januar 2020 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.


    \_(ツ)_/

    Dienstag, 28. Januar 2020 09:39
    Moderator
  • 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.


    Dienstag, 28. Januar 2020 10:44
  • To save everyones time.

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

    Dienstag, 28. Januar 2020 12:30
  • It should be great if you shared your solution for others who would see the thread.

    The key of learning is practice.

    Dienstag, 28. Januar 2020 12:54
  • ****** It should be great if you shared your solution for others who would see the thread. *******


    \_(ツ)_/

    Dienstag, 28. Januar 2020 14:56
    Moderator
  • 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.

    Mittwoch, 29. Januar 2020 12:27