Wednesday, 20 August 2014

PSEXEC --> Overview & Usage


 Issue Overview:

High time i post the solution of one of the major issues i faced in my Project. I have around 18 Environments to monitor on a daily basis. SOD checks and then send out a status report, boring right :| ... Totally agree. Well for few months i struggled a lot trying to use 1 srvrmgr utility to track and Automate the status of all Environments but Servers from different domain were either Handshake Failed or Connect Failed,  too much frustrating :(





Trick:

Well solution is a simple utility which a Window's ADMIN might be using in his day to day  life:
PSEXEC
Worked like a charm and below is the syntax:

psexec IPAddressOfTargetServer -u "Domain\UserID" -p Password "CommandOrScriptToExecute"

Well Yeah i know sounds easy, I will run the script from any source to a target domain, hmmm... there is the mistake. When i do that as a scheduled job, all I see is like its running forever. Why is that ???

Reason being the fact when I run it the first time it always asks me to accept the License through a pop-up option, which if I execute directly is cool. But when I schedule it remotely, the schedule job is not smart enough to take care of it unless I take care of it within the script to accept the License using the below command:

psexec IPAddressOfTargetServer /accepteula -u "Domain\UserID" -p Password "CommandOrScriptToExecute"

Works Like a CHARM !!!





Regards,
VG

No comments:

Post a Comment