REM *********************************************** REM Script distributes custom sensors REM to defined remote probe servers REM REM Created: Urs Heeb/10.12.18 REM REM Modified/Changelog: REM nnnvvv/YYMMDD: Change example REM REM ************************************************ @ECHO OFF REM Variable for Loops Setlocal EnableDelayedExpansion REM Set base variables SET SensorPath=\C$\Program Files (x86)\PRTG Network Monitor\Custom Sensors SET PRTGServer=prtgcore.domain.pit REM Set the array of PRTG Remote Probes REM Add a line and increase the number in the bracket with every additional probe server SET PRTGProbe[0]=prtgprobe1.domain.pit SET PRTGProbe[1]=prtgprobe2.domain.pit SET PRTGProbe[2]=prtgprobe3.domain.pit SET PRTGProbes=0 :PRTGCount REM Calculate the correct count of PRTG Remote Probes IF defined PRTGProbe[%PRTGProbes%] ( SET /a "PRTGProbes+=1" GOTO PRTGCount ) REM The calculating procedure count one too much. This will be decreased. SET /a PRTGProbes=%PRTGProbes%-1 ECHO "\\%PRTGServer%%SensorPath%" REM Copy the custom sensors to each PRTG Remote Probe FOR /l %%n in (0,1,%PRTGProbes%) do ( ROBOCOPY "\\%PRTGServer%%SensorPath%" "\\!PRTGProbe[%%n]!%SensorPath%" /E /R:1 /W:1 /COPYALL ) ECHO. ECHO. ECHO. ECHO #################################################### ECHO Custom sensors copied to all PRTG Remote Probes. ECHO Press the ANY KEY to close this window. ECHO #################################################### PAUSE > NUL