remote exe execution, not working as expected

Welcome Forums General PowerShell Q&A remote exe execution, not working as expected

This topic contains 2 replies, has 3 voices, and was last updated by

10 months, 2 weeks ago.

  • Author
  • #103630

    Topics: 2
    Replies: 0
    Points: 12
    Rank: Member


    I have a exe file on remote computer which opens a browser and run some test cases when i run it. Now, When i try to run the same exe file remotely through PowerShell script it is not working as expected and giving some wrong output. If i login to remote computer manually and run the exe file it is working as expected.

    i need to open a new remote session then open a new command prompt and then run the exe, how can achieve it through PowerShell script. Below is the script i have written

    $Username = 'MYDomain\Prabha-K'
    $Password = 'pas@123'
    $pass = ConvertTo-SecureString -AsPlainText $Password -Force
    $Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
    Invoke-command -ScriptBlock { & 'C:\nxtdr\SmokeTest.exe' -something "AllTestCases"} -Credential $cred -Verbose -ComputerName

  • #103633

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Remote sessions don't have a full user profile and can't run anything GUI-based. That's likely the difference.

  • #103673

    Topics: 5
    Replies: 8
    Points: 3
    Rank: Member

    You could put the exe in the StartUp programs and use powershell to restart the computer.

The topic ‘remote exe execution, not working as expected’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort