Install file on remote computer using powershell

This topic contains 3 replies, has 2 voices, and was last updated by  Don Jones 2 years, 6 months ago.

  • Author
  • #23912

    Kaustubh Kharche

    I want to install a .exe file already present on remote machine. I want to pop up the window of executable file using powershell. I treid PS remoting..but i saw only process was created with CPU usage 0%.. and the GUI i popped up was soon became "not responding". I dont want to use any external tools like "PSTOOLs"..also i tried task scheduler which is OS dependent... Is there any generic way ..??

    i just want to Pop up GUI of executable.

  • #23914

    Don Jones

    Windows is a multi-user operating system. When you remote "into" a remote machine, you get a separate "user space" than whatever user might be logged on interactively to the same machine. Remoting doesn't offer any way for processes that you start to interact with other users – that's actually a security feature.

    So no, PowerShell doesn't natively offer a way to pop up a GUI of an executable into another user's process space, unless you've "remoted in" by using that user's username and password.

    Windows technically has the ability to run multiple interactive sessions (this is how Remote Desktop works) on one machine. So in that case, how would it know which user's space to "pop" the GUI into? The fact that you may be remoting into a client that only has one interactive user doesn't matter to the OS; it's just how it's built.

  • #23942

    Kaustubh Kharche

    1) is there any way to acquire specific "user space" while remotely logging in..??

    2) I have "remoted in" by using that user's username and password, in whose userpace i wanted to popup the GUI didnt worked...(i have only one user on my remote machine (windows server 2012) that is administrator).
    i used commands as::

    $ComputerName = "win12"
    $cr=Get-Credential $ComputerName\administrator
    $Session = New-PSSession -ComputerName $ComputerName -Credential $cr

    Invoke-Command -Session $Session -ScriptBlock {
    Start-Process -FilePath 'C:\xyz.exe' -ArgumentList '/a' -Verb runas -WindowStyle Normal

  • #23946

    Don Jones

    Not without rewriting the Windows kernel, no, there isn't.

You must be logged in to reply to this topic.