edpatterson
IS-IT--Management
- Feb 24, 2005
- 186
Sigh, now that I have the log file working... 
I need to add a local administrator to about 400 machines. I want to do this with out adding a login script for the machines via GPO. PsTools immediately came to mind. I am reading the list of machines from a text file; Using my.computer.network.ping** to see if it is available; Then a shell() command to do the deed
The program runs, logs the machine names and apparently works. When I check nothing has changed. So I thought one huge friggin batch file.
calling fixlocal.cmd <machineName> from a cmd session error out with 'The specified application is not on the path'. Since the error comes from psexec I assume it means the batch file. Problem with that is all of it is in the path.
The exact same command manually entered into the same cmd window works perfectly.
Ideas?
** As a side note: It appears that my.computer.network.ping does not return false if a machine name is not resolved. It throws an exception instead.
I need to add a local administrator to about 400 machines. I want to do this with out adding a login script for the machines via GPO. PsTools immediately came to mind. I am reading the list of machines from a text file; Using my.computer.network.ping** to see if it is available; Then a shell() command to do the deed
Code:
shell(psexec \\" & strComputer & " -u administrator -p password -c " & Chr(34) & "c:\addAdmin.cmd" & Chr(34))
Code:
:fixLocal.cmd:
psexec \\%1 -u administrator -p password -c addAdmin.cmd
The exact same command manually entered into the same cmd window works perfectly.
Ideas?
** As a side note: It appears that my.computer.network.ping does not return false if a machine name is not resolved. It throws an exception instead.