How to start process remotely with admin console

This topic contains 5 replies, has 3 voices, and was last updated by  Salem Maloum 4 years, 3 months ago.

  • Author
    Posts
  • #9493

    Salem Maloum
    Participant

    Dear all,

    I have to start a process remotely with login as console like:
    mstsc /admin or /console, then "start myprogram.exe GP01"

    I have powershell V2, I tried with: invoke-command and
    invoke-wmimethod but same.
    Any one has any idea?
    Thanks.

  • #9501

    Poshoholic
    Participant

    You need to share what you ran and what the results you received were in here in order for someone to be able to help you. Otherwise you're leaving us in the dark.

  • #9570

    Salem Maloum
    Participant

    Good day everybody,

    Ok Posholic,

    I ran: invoke-command -computername server1 {start c:\myprocess GP1} nothing

    also invoke-wmimethod -path win32_process -name create -argumentlist {start c:\myprocess GP1}

    I got nothing with Returnvalue: 9

    Just I need to run this command on console session not any session created, like when I logon with: mstsc /console

    Also when I logon on this server with mstsc /admin, and I execute this with powershell:
    start c:\myprocess GP1

    It runs perfectly

    Just for reminder I have powershell V2.

    I know it weird but this program should start in console session and not in other session.

    Thanks for your help

  • #9571

    Dave Wyatt
    Moderator

    As far as I know, this isn't possible with PowerShell remoting, but you might be able to make it work with PSExec, which you can download from Microsoft if you don't have it already. PSExec's "-i" argument with no session specified is supposed to make the command interact with the console session. I haven't tested this syntax, but the command would probably look something like this:

    psexec.exe \\server1 -i powershell.exe -Command start c:\myprocess GP1
    
  • #9572

    Salem Maloum
    Participant

    Ok Dave thanks,

    I will try and revert back to you.

  • #9598

    Salem Maloum
    Participant

    Hi Dave,

    I tried this from my workstation:

    psexec \\Myserver -i powershell -command start "E:\STARTUP\StartNStopFiles\SyncDB_recover" -WindowStyle minimized -ArgumentList GP01

    But it doesn't work, same as powershell, process is being executed but I don't see the windows in console screen.

    Thanks for your suggestion

You must be logged in to reply to this topic.