Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 586
  • Last Modified:

PSEXEC Log?

Is there any command I can use in my PSexec scripts to get it to record what it installed?  I used PSExec to install some software with a list of PC's.  I'm wanting to know basically if I can record what scrolls on the command screen to a txt file so I know what has installed and what has failed?
0
WellingtonIS
Asked:
WellingtonIS
  • 2
  • 2
1 Solution
 
rhandelsCommented:
Hey,

Yes you can. At the end of the command just type in > d:\Myfolder\log.txt (where you can add any path you would like to offcourse) this PIPE's all to a text file.
0
 
WellingtonISAuthor Commented:
ok I have 3 commands in this particular bat file.  Does it matter which one or is it only going to record what command I add it to?  

Here's the command for example...
Psexec \\@%var% -u xx\xxx -p xxx cmd /c copy "\\sss\sss\WRM_ssoCA.cer" c:\
psexec \\@%var% -u xxx\xxx -p xxx cmd /c copy "\\sss\sss\certmgr.exe" c:\

psexec \\@%var% cmd /c c:\certmgr.exe -add -all c:\WRM_ssoCA.cer -s -r localmachine root

psexec \\@%var% -s cmd /c del "c:\WRM_ssoCA.cer"
psexec \\@%var% -s cmd /c del "c:\certmgr.exe"
0
 
rhandelsCommented:
Add it after every command line you execute. Do keep in mind that using 1 > is overwriting the file (so don't add the same log file after every line with a single >, the last one will overwrite the one before which will overwrite the one before..

If you want to add them all to one file use 2 >>'s. So your command file would be below. All appended into one text file.

Psexec \\@%var% -u xx\xxx -p xxx cmd /c copy "\\sss\sss\WRM_ssoCA.cer" c:\ >> D:\Logfile.txt
psexec \\@%var% -u xxx\xxx -p xxx cmd /c copy "\\sss\sss\certmgr.exe" c:\ >> D:\Logfile.txt

psexec \\@%var% cmd /c c:\certmgr.exe -add -all c:\WRM_ssoCA.cer -s -r localmachine root >> D:\Logfile.txt

psexec \\@%var% -s cmd /c del "c:\WRM_ssoCA.cer" >> D:\Logfile.txt
psexec \\@%var% -s cmd /c del "c:\certmgr.exe" >> D:\Logfile.txt
0
 
WellingtonISAuthor Commented:
thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now