Link to home
Start Free TrialLog in
Avatar of PurplePenguin
PurplePenguinFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PSExec How to.

Hi,

I would like to use psexec to run an agent on all machines on the network.
I am using Lansweeper to scan all machines and was going to use a logon script until it was pointed out that psexec was a better way of doing this.

Can anyone give me instructions on how to use this tool effectively.

Many thanks
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

simple case

psexec \\acomputer -c filename.exe
SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PurplePenguin

ASKER

I am assuming that I run the psexec from the computer that has Lansweeper on it and also where the Lansweeper agent is and then when the psexec runs all the computers in batch file will have the agent and will continue to work after that?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes you are right. -d disconnects from it but it keeps running on the target computer
To Cyberkiwi, - Excellent I will give this a go.  This is very helpful.

To Steve,

The FOR loop bit does that go on the end of the batch file after the psexec and all the computers - sorry to ask so many questions but just want to be sure I understand exactly.  Or is the list of computers separate and then the batch file references it when it runs, as per the script you have posted above.
If this is an agent that stays active (confused myself now) then it probably dosn't make much difference whether you run it remotely using psexec etc. or let the user run it on logon from logon script.  I don't know the app very well so you'll have to experiment to see what works best for you.
Steve
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK many thanks for all your help and to Cyberkiwi as well and I will see how it goes.  I will close this for now but if needs be I will add another related question if that is possible.  It may be a while before I come back to the forum and so do not want this question to be viewed as abandoned.

Have great rest of the day to you both. Cheerio!!!!!
Excellent help from two brilliant experts - Many thanks.
No problem, there are always lots of ways of doing things so give them a try and ask if you need any help.  If you ask a "related question" then we hear of it, though many people will see alerts for the Q's anyway.

Steve