Avatar of joukiejouk
joukiejouk

asked on 

Need to have PSEXEC or .bat script return a log file (.txt) after deploying an MSI to remote machines

I am currently deploying a plugin (.MSI) to remote machines using PSEXEC to call a script. Each time I deploy  via PSEXEC, I get a bunch of "Process ID" result. It is hard to tell if the deployment was successful or not. Logging is enabled on the script (attached) to where I can see logs for each machine that I deploy to. However, it is not feasible to go into each machine to look at logs. Can someone please help modify the .bat file script to produce a log (.txt) that will tell me if the deployment was successful on the remote machines I deploy to? I'd like a txt file to be produced on the desktop of the server I am executing psexec from (e.g. - Server1). I want the convenient of just looking at the txt file that will show me which machines failed so I can keep track of it.  

PSEXEC commands from Server1:
User generated image
.BAT script is attached, but for the purpose of this thread, i changed it to .txt.
Mimecastdeploy_OUTL2013_x64.txt
VB ScriptWindows Server 2008Windows Networking

Avatar of undefined
Last Comment
joukiejouk
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of joukiejouk
joukiejouk

ASKER

So I entered the command as such:
User generated image
I never got a prompt to enter my password. It does not appear to do anything as nothing return when I execute the command. Not sure if my commands are set correctly, but maybe you can tell.

I got into C:, and see that the psdetails.txt and psresults.txt do generate.
User generated image
I open psdetail.txt, and this is what I get:
User generated image
I open psresult.txt, and this is what I get:
User generated image
As a result, the deployment to the remote machines were not successful. Maybe you can pin point where I went wrong.
Avatar of NVIT
NVIT
Flag of United States of America image

It's asking for your password. You have to enter it when it seems to hang, unless you use the -p switch with the password.
SOLUTION
Avatar of Coralon
Coralon
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of NVIT
NVIT
Flag of United States of America image

joukiejouk,

Correction: In my last post, all references to c:\results.txt should be c:\psresults.txt
Avatar of joukiejouk
joukiejouk

ASKER

I never got a chance to re-visit the script option to set logging. Anyhoot, the deployment has been completed so I am not gong to worry about it. Thanks for the response.
Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo