.
.
If you ever had to manage a multi Domain where every time you need to execute even a batch file you would have to authenticate…
Well I do use psexec.exe but since I had many problems where it does not copy the local file to remote then execute, i wrote this
script. In this specific case I was installing the Nagios Agent NRPE_NT to over 80 servers each server in a different Domain, at
least they all had the same admin password and I was able to dynamic get the domain names.
Requirements:
* computers.txt (list of all hosts)
* psexec.exe [link=http://www.softpedia.com/progDownload/PsExec-Download-35253.html]Download[/link]
* same password in all domains, not so different domain names (but could be done if passed from text file)

RemoteExec Download

The Simple Nagios.bat

@REM ::SCRIPT PARA INSTACION DEL CLIENTE DE NAGIOS Y QUITA LOS AGENTES DE NSM
@echo on
cd
cls
@echo.
@echo Installing Nagios Agent
c:nrpe_ntnrpe_nt.exe -i
@echo.
@echo Stopping CA-Unicenter...
net stop ca-unicenter
@echo.
@echo Stopping DSM Common Frameword..
net stop caf
@echo.
@echo Uninstalling DSM Agent +
MsiExec.exe /X{624FA386-3A39-4EBF-9CB9-C2B484D78B29} /passive
@echo.
@echo Uninstalling DSM DPRimer
MsiExec.exe /X{5933CC13-52AB-4713-85DB-E72034B5697A} /passive
@echo.
@echo Uninstalling Unicenter DSM
C:CA_APPSWTNGRMVEX.EXE -U "c:nrpe_ntuninstall.rsp" -p "Unicenter NSM"
@echo.
@echo Starting NRPE Agente
net start nrpe_nt
@echo.
echo ->>>>>>>> DONE <<<<<<<<- exit

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *