PsExec treats second remote computer in list as a program name











up vote
0
down vote

favorite












PsExec behaves very strangely when run on a specific server



When I use PsExec to run a program on multiple remote machines in most cases, it works perfectly fine. When I run the same command on one specific machine, it treats the second server provided in the comma-separated list like it's a program name.



Here's my call to the remote servers:



psexec \server11111,server11112 /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


And here's the output:



PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

PsExec could not start server11112 on server11111:
The system cannot find the file specified


This command works fine when I run it on my dev machine. However, when I run the same command from a server running Windows 2012, it fails and I get the output above.










share|improve this question
























  • The name of the computer might be the key, it might have a special character which might need to be escaped.
    – davidbaumann
    Dec 3 at 16:25










  • @davidbaumann the names will always be like "harvest99999". They'll only have the server type and number with no special characters.
    – Jason Fox
    Dec 3 at 17:19










  • @TwistyImpersonator I am not. The PsExec spec shows that you only have to put the backslashes once for a comma-separated computer list.
    – Jason Fox
    Dec 3 at 17:20












  • @TwistyImpersonator Done. The description should be functionally equivalent to what I'm doing now.
    – Jason Fox
    Dec 3 at 19:08










  • Much better. This command works for me if I remove the backslash preceding psexec (is that just a formatting mistake)?. Does session #2 actually exist on both target machines?
    – Twisty Impersonator
    Dec 3 at 19:42















up vote
0
down vote

favorite












PsExec behaves very strangely when run on a specific server



When I use PsExec to run a program on multiple remote machines in most cases, it works perfectly fine. When I run the same command on one specific machine, it treats the second server provided in the comma-separated list like it's a program name.



Here's my call to the remote servers:



psexec \server11111,server11112 /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


And here's the output:



PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

PsExec could not start server11112 on server11111:
The system cannot find the file specified


This command works fine when I run it on my dev machine. However, when I run the same command from a server running Windows 2012, it fails and I get the output above.










share|improve this question
























  • The name of the computer might be the key, it might have a special character which might need to be escaped.
    – davidbaumann
    Dec 3 at 16:25










  • @davidbaumann the names will always be like "harvest99999". They'll only have the server type and number with no special characters.
    – Jason Fox
    Dec 3 at 17:19










  • @TwistyImpersonator I am not. The PsExec spec shows that you only have to put the backslashes once for a comma-separated computer list.
    – Jason Fox
    Dec 3 at 17:20












  • @TwistyImpersonator Done. The description should be functionally equivalent to what I'm doing now.
    – Jason Fox
    Dec 3 at 19:08










  • Much better. This command works for me if I remove the backslash preceding psexec (is that just a formatting mistake)?. Does session #2 actually exist on both target machines?
    – Twisty Impersonator
    Dec 3 at 19:42













up vote
0
down vote

favorite









up vote
0
down vote

favorite











PsExec behaves very strangely when run on a specific server



When I use PsExec to run a program on multiple remote machines in most cases, it works perfectly fine. When I run the same command on one specific machine, it treats the second server provided in the comma-separated list like it's a program name.



Here's my call to the remote servers:



psexec \server11111,server11112 /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


And here's the output:



PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

PsExec could not start server11112 on server11111:
The system cannot find the file specified


This command works fine when I run it on my dev machine. However, when I run the same command from a server running Windows 2012, it fails and I get the output above.










share|improve this question















PsExec behaves very strangely when run on a specific server



When I use PsExec to run a program on multiple remote machines in most cases, it works perfectly fine. When I run the same command on one specific machine, it treats the second server provided in the comma-separated list like it's a program name.



Here's my call to the remote servers:



psexec \server11111,server11112 /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


And here's the output:



PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

PsExec could not start server11112 on server11111:
The system cannot find the file specified


This command works fine when I run it on my dev machine. However, when I run the same command from a server running Windows 2012, it fails and I get the output above.







powershell psexec sysinternals






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 3 at 20:57

























asked Dec 3 at 15:58









Jason Fox

33




33












  • The name of the computer might be the key, it might have a special character which might need to be escaped.
    – davidbaumann
    Dec 3 at 16:25










  • @davidbaumann the names will always be like "harvest99999". They'll only have the server type and number with no special characters.
    – Jason Fox
    Dec 3 at 17:19










  • @TwistyImpersonator I am not. The PsExec spec shows that you only have to put the backslashes once for a comma-separated computer list.
    – Jason Fox
    Dec 3 at 17:20












  • @TwistyImpersonator Done. The description should be functionally equivalent to what I'm doing now.
    – Jason Fox
    Dec 3 at 19:08










  • Much better. This command works for me if I remove the backslash preceding psexec (is that just a formatting mistake)?. Does session #2 actually exist on both target machines?
    – Twisty Impersonator
    Dec 3 at 19:42


















  • The name of the computer might be the key, it might have a special character which might need to be escaped.
    – davidbaumann
    Dec 3 at 16:25










  • @davidbaumann the names will always be like "harvest99999". They'll only have the server type and number with no special characters.
    – Jason Fox
    Dec 3 at 17:19










  • @TwistyImpersonator I am not. The PsExec spec shows that you only have to put the backslashes once for a comma-separated computer list.
    – Jason Fox
    Dec 3 at 17:20












  • @TwistyImpersonator Done. The description should be functionally equivalent to what I'm doing now.
    – Jason Fox
    Dec 3 at 19:08










  • Much better. This command works for me if I remove the backslash preceding psexec (is that just a formatting mistake)?. Does session #2 actually exist on both target machines?
    – Twisty Impersonator
    Dec 3 at 19:42
















The name of the computer might be the key, it might have a special character which might need to be escaped.
– davidbaumann
Dec 3 at 16:25




The name of the computer might be the key, it might have a special character which might need to be escaped.
– davidbaumann
Dec 3 at 16:25












@davidbaumann the names will always be like "harvest99999". They'll only have the server type and number with no special characters.
– Jason Fox
Dec 3 at 17:19




@davidbaumann the names will always be like "harvest99999". They'll only have the server type and number with no special characters.
– Jason Fox
Dec 3 at 17:19












@TwistyImpersonator I am not. The PsExec spec shows that you only have to put the backslashes once for a comma-separated computer list.
– Jason Fox
Dec 3 at 17:20






@TwistyImpersonator I am not. The PsExec spec shows that you only have to put the backslashes once for a comma-separated computer list.
– Jason Fox
Dec 3 at 17:20














@TwistyImpersonator Done. The description should be functionally equivalent to what I'm doing now.
– Jason Fox
Dec 3 at 19:08




@TwistyImpersonator Done. The description should be functionally equivalent to what I'm doing now.
– Jason Fox
Dec 3 at 19:08












Much better. This command works for me if I remove the backslash preceding psexec (is that just a formatting mistake)?. Does session #2 actually exist on both target machines?
– Twisty Impersonator
Dec 3 at 19:42




Much better. This command works for me if I remove the backslash preceding psexec (is that just a formatting mistake)?. Does session #2 actually exist on both target machines?
– Twisty Impersonator
Dec 3 at 19:42










3 Answers
3






active

oldest

votes

















up vote
1
down vote



accepted










To expand on Patrick's answer, instead of listing servers with the \computer[,computer2[,...] format, you can use a list of computers from a text file.



From the psexec documentation (through psexec /?):



Usage: psexec [\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]

@file PsExec will execute the command on each of the computers listed
in the file.


That is, you can create a text file (for example computers.txt) in the directory you're working from filled with computer names:



computer
computer2
computer3


Then you can use the command:



psexec @computers.txt /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


psexec will then run the command on each computer in order as specificed in computers.txt.






share|improve this answer




























    up vote
    -1
    down vote













    Maybe you have a non-displaying character after the comma. I get the exact same




    PsExec could not start <server2> on <server1>:




    error if I have a space after the comma.






    share|improve this answer























    • Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
      – Jason Fox
      Dec 4 at 15:38










    • In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
      – Doug Deden
      Dec 4 at 22:34


















    up vote
    -1
    down vote













    Call a list not from the commandline:



    psexec @ListOfServers /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"





    share|improve this answer










    New contributor




    Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.














    • 1




      This answer could be much improved by explaining how the list of servers works.
      – Worthwelle
      yesterday











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1380430%2fpsexec-treats-second-remote-computer-in-list-as-a-program-name%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    To expand on Patrick's answer, instead of listing servers with the \computer[,computer2[,...] format, you can use a list of computers from a text file.



    From the psexec documentation (through psexec /?):



    Usage: psexec [\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]

    @file PsExec will execute the command on each of the computers listed
    in the file.


    That is, you can create a text file (for example computers.txt) in the directory you're working from filled with computer names:



    computer
    computer2
    computer3


    Then you can use the command:



    psexec @computers.txt /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


    psexec will then run the command on each computer in order as specificed in computers.txt.






    share|improve this answer

























      up vote
      1
      down vote



      accepted










      To expand on Patrick's answer, instead of listing servers with the \computer[,computer2[,...] format, you can use a list of computers from a text file.



      From the psexec documentation (through psexec /?):



      Usage: psexec [\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]

      @file PsExec will execute the command on each of the computers listed
      in the file.


      That is, you can create a text file (for example computers.txt) in the directory you're working from filled with computer names:



      computer
      computer2
      computer3


      Then you can use the command:



      psexec @computers.txt /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


      psexec will then run the command on each computer in order as specificed in computers.txt.






      share|improve this answer























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        To expand on Patrick's answer, instead of listing servers with the \computer[,computer2[,...] format, you can use a list of computers from a text file.



        From the psexec documentation (through psexec /?):



        Usage: psexec [\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]

        @file PsExec will execute the command on each of the computers listed
        in the file.


        That is, you can create a text file (for example computers.txt) in the directory you're working from filled with computer names:



        computer
        computer2
        computer3


        Then you can use the command:



        psexec @computers.txt /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


        psexec will then run the command on each computer in order as specificed in computers.txt.






        share|improve this answer












        To expand on Patrick's answer, instead of listing servers with the \computer[,computer2[,...] format, you can use a list of computers from a text file.



        From the psexec documentation (through psexec /?):



        Usage: psexec [\computer[,computer2[,...] | @file]][-u user [-p psswd][-n s][-r servicename][-h][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-<priority>][-a n,n,...] cmd [arguments]

        @file PsExec will execute the command on each of the computers listed
        in the file.


        That is, you can create a text file (for example computers.txt) in the directory you're working from filled with computer names:



        computer
        computer2
        computer3


        Then you can use the command:



        psexec @computers.txt /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"


        psexec will then run the command on each computer in order as specificed in computers.txt.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Worthwelle

        2,2993924




        2,2993924
























            up vote
            -1
            down vote













            Maybe you have a non-displaying character after the comma. I get the exact same




            PsExec could not start <server2> on <server1>:




            error if I have a space after the comma.






            share|improve this answer























            • Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
              – Jason Fox
              Dec 4 at 15:38










            • In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
              – Doug Deden
              Dec 4 at 22:34















            up vote
            -1
            down vote













            Maybe you have a non-displaying character after the comma. I get the exact same




            PsExec could not start <server2> on <server1>:




            error if I have a space after the comma.






            share|improve this answer























            • Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
              – Jason Fox
              Dec 4 at 15:38










            • In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
              – Doug Deden
              Dec 4 at 22:34













            up vote
            -1
            down vote










            up vote
            -1
            down vote









            Maybe you have a non-displaying character after the comma. I get the exact same




            PsExec could not start <server2> on <server1>:




            error if I have a space after the comma.






            share|improve this answer














            Maybe you have a non-displaying character after the comma. I get the exact same




            PsExec could not start <server2> on <server1>:




            error if I have a space after the comma.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 3 at 23:43

























            answered Dec 3 at 23:21









            Doug Deden

            13




            13












            • Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
              – Jason Fox
              Dec 4 at 15:38










            • In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
              – Doug Deden
              Dec 4 at 22:34


















            • Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
              – Jason Fox
              Dec 4 at 15:38










            • In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
              – Doug Deden
              Dec 4 at 22:34
















            Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
            – Jason Fox
            Dec 4 at 15:38




            Do you know what characters could be non-displaying in powershell? It is acting as if there were a space there, because putting double quotes around the entire server list fixes it for some reason.
            – Jason Fox
            Dec 4 at 15:38












            In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
            – Doug Deden
            Dec 4 at 22:34




            In other contexts, the Zero-Width Space and Left-To-Right Mark are the ones that have tripped me up. You can try saving the string to a file and opening it with a hex editor, like Frhed to see what character might be hiding in there.
            – Doug Deden
            Dec 4 at 22:34










            up vote
            -1
            down vote













            Call a list not from the commandline:



            psexec @ListOfServers /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"





            share|improve this answer










            New contributor




            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.














            • 1




              This answer could be much improved by explaining how the list of servers works.
              – Worthwelle
              yesterday















            up vote
            -1
            down vote













            Call a list not from the commandline:



            psexec @ListOfServers /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"





            share|improve this answer










            New contributor




            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.














            • 1




              This answer could be much improved by explaining how the list of servers works.
              – Worthwelle
              yesterday













            up vote
            -1
            down vote










            up vote
            -1
            down vote









            Call a list not from the commandline:



            psexec @ListOfServers /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"





            share|improve this answer










            New contributor




            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            Call a list not from the commandline:



            psexec @ListOfServers /accepteula -u "DomainUser" -p "password" -i 2 -d cmd.exe /c "wmic bios getsmbiosbiosversion"






            share|improve this answer










            New contributor




            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer








            edited yesterday









            Worthwelle

            2,2993924




            2,2993924






            New contributor




            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered yesterday









            Patrick

            1




            1




            New contributor




            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Patrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.








            • 1




              This answer could be much improved by explaining how the list of servers works.
              – Worthwelle
              yesterday














            • 1




              This answer could be much improved by explaining how the list of servers works.
              – Worthwelle
              yesterday








            1




            1




            This answer could be much improved by explaining how the list of servers works.
            – Worthwelle
            yesterday




            This answer could be much improved by explaining how the list of servers works.
            – Worthwelle
            yesterday


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1380430%2fpsexec-treats-second-remote-computer-in-list-as-a-program-name%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mouse cursor on multiple screens with different PPI

            Agildo Ribeiro

            Sometime when accessing a menu: “Ubuntu 16.04 has experienced an internal error”