{"id":2131,"date":"2014-02-25T15:39:20","date_gmt":"2014-02-25T15:39:20","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=2131"},"modified":"2015-03-03T15:38:35","modified_gmt":"2015-03-03T15:38:35","slug":"executing-ipconfig-and-other-commands-on-remote-machines","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=2131","title":{"rendered":"Executing ipconfig and other commands on remote machines"},"content":{"rendered":"<p>To execute the &#8220;ipconfig \/all&#8221; command on one or more remote machines you can use the psexec utility that is part of pstools, available from Microsoft. The syntax is: pstools \\\\machine_name command<br \/>\nFor example:<\/p>\n<p>C:\\Users\\dmatthews\\Desktop\\pstools&gt;psexec \\\\L00151270 ipconfig \/all<\/p>\n<p>To list just the IP version 4 address, pipe the output throught the &#8216;find&#8217; command:<\/p>\n<p>C:\\Users\\dmatthews\\Desktop\\pstools&gt;psexec \\\\L00151270 ipconfig \/all | find &#8220;IPv4&#8221;<!--more--><\/p>\n<p>If you have a number of machines that you wish to enumerate, you can use the syntact pstools @filename where filename is a list of machine names:<\/p>\n<p>C:\\Users\\dmatthew\\Desktop\\pstools&gt;type INPUT-DATA.txt<br \/>\nL00151270<br \/>\nL00151309<\/p>\n<p>For example:<br \/>\nC:\\Users\\dmatthew\\Desktop\\pstools&gt;psexec @INPUT-DATA.txt ipconfig \/all | find &#8220;IPv4&#8221;<\/p>\n<p>Starting ipconfig on L00151270&#8230; L00151270&#8230;<br \/>\nIPv4 Address. . . . . . . . . . . : 172.23.24.22(Preferred)<br \/>\nipconfig exited on L00151270 with error code 0.<br \/>\nStarting ipconfig on L00151309&#8230; L00151309&#8230;<br \/>\nIPv4 Address. . . . . . . . . . . : 172.23.25.32(Preferred)<br \/>\nipconfig exited on L00151309 with error code 0.<\/p>\n<p>Finally you can redirect the output into a text file:<\/p>\n<p>C:\\Users\\dmatthew\\Desktop\\pstools&gt;psexec @INPUT-DATA.txt ipconfig \/all | find &#8220;IPv4&#8221; &gt;&gt; RESULTS.txt<\/p>\n<p>Starting ipconfig on L00151270&#8230; L00151270&#8230;<br \/>\nipconfig exited on L00151270 with error code 0.<br \/>\nStarting ipconfig on L00151309&#8230; L00151309&#8230;<br \/>\nipconfig exited on L00151309 with error code 0.<\/p>\n<p>C:\\Users\\dmatthew\\Desktop\\pstools&gt;type RESULTS.txt<br \/>\nIPv4 Address. . . . . . . . . . . : 172.23.24.22(Preferred)<br \/>\nIPv4 Address. . . . . . . . . . . : 172.23.25.32(Preferred)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To execute the &#8220;ipconfig \/all&#8221; command on one or more remote machines you can use the psexec utility that is part of pstools, available from Microsoft. The syntax is: pstools \\\\machine_name command For example: C:\\Users\\dmatthews\\Desktop\\pstools&gt;psexec \\\\L00151270 ipconfig \/all To list just the IP version 4 address, pipe the output throught the &#8216;find&#8217; command: C:\\Users\\dmatthews\\Desktop\\pstools&gt;psexec \\\\L00151270 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10,13],"tags":[],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2131"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2131"}],"version-history":[{"count":4,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2131\/revisions"}],"predecessor-version":[{"id":2145,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2131\/revisions\/2145"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}