Installing sccm agent with psexec on a list of computers

Aamer M
Aamer M used Ask the Experts™
on
I want to install the SCCM agent on a list of computers listed in the text file  c:\temp\list.txt from my computer using the command below.

PSEXEC @”:C\temp\list.txt” –d –h –s –c  “C:\temp\sccmclient.bat”

The sccmclient.bat should do the following
Run this command
CCMSETEP.EXE SMSSITECODE=ABC

The ccmsetup.exe is in a shared folder on \\fileserver1\share1\ccmsetup.exe

I want to run this command with elevated privileges so want to include username and password in the above PSEXEC command.
I tried it with quotes, without quotes but looks simple but this thing does not work.
Appreciate some help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:
You need -u and -p for network access. Make sure your use PSEXEC 2.1 or above to ensure password is not transmitted clear-text over the wire
PSEXEC @":C\temp\list.txt" -u USERNAME -p PASSWORD –d –h –s –c  "C:\temp\sccmclient.bat"

Open in new window

Author

Commented:
Thanks,

PSEXEC @c:\temp\LIST.TXT /accepteula -U abc\user -d -h -s -c "C:\temp\sccmclient.bat"

the command output says it started and ran the sccmclient.bat file on the remote computer but the ccmsetup.exe does not start on the remote computers.

please give me the sccmclient.bat file details

in the sccmclient.bat batch file i have a simple command

i tried the below command in the sccmclient.bat file bit does not run

"\\fileserver\share\ccmsetup.exe"
Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:
Why don't you first copy CCMSETUP.EXE locally with robocopy etc.?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial