-1

i can run remote commands without any problem and get output to my local machine with psexec. but one of the command can export result as xml so i also send this parameter to save output as xml. during the process it shows information about progress but all in text format. the file i want to read is xml when i try to redirect this xml output to my local it doesnt. it only redirects this text based message on console.

PsExec.exe \dc01 cmd /c dcdiag /test:DNS /DNSALL /e /v >test.txt this way i can get output in text format without any problem.

PsExec.exe \dc01 cmd /c dcdiag /test:DNS /DNSALL /e /v /x:test.xml but i need to send this x:/ paramter and log file name to remote computer to get output as xml format.

PsExec.exe \dc01 cmd /c dcdiag /test:DNS /DNSALL /e /v /x:test.xml >test.xml when i run this way it saves my local machine the output on the console screen(which is text based not xml) so i want to get output file as xml.

how can i do it ?

1 Answers1

-1

Maybe its possible to set output path through network

if your command succesfully generates a local xml file test.xml why not add a path to your mashine:

/x:\\yourMashine_fqdn\c$\path\to\file.xml

as an alternative you can write a script with a copy command after dcdiag.

it doesnt matter if the script is local bcause psexec can copy it to the remote mashine with the -c parameter

Magnus
  • 29
  • 1
  • 7