Export errorlevel to log

April 12, 2011 at 07:56:03
Specs: Windows 7
Hey guys,

I'm running a quick .bat to inject a SCCM account into all Administrator groups across our domain. The script is:

psexec @Computers.txt net localgroup Administrators "DOMAIN\svcsccm-push" /add

This is going through 1200 computers, and I would like to see the error codes (and the log file) exported to a file so that I can see which computers didn't get the command. I know using a GPO would be the easier solution, but that's for a different forum.

Ideally something like:

\\computer returned error code 0 or 1
\\computer could not be found on the domain

Basically whatever the DOS window shows would be great.


See More: Export errorlevel to log

Report •

April 12, 2011 at 15:41:52
i think psexec @Computers.txt net localgroup Administrators "DOMAIN\svcsccm-push" /add >log.txt should do it.

Before running on 1200 computers try on 2-3 first from a dummy computer.txt/

Subhash Chandra.

Report •

April 13, 2011 at 06:47:59
Well, unfortunately not really. The output looks like this:

\\[computer name]:
\\[computer name]:

It doesn't return any errorcodes

Report •

Related Solutions

Ask Question