I use the batch file below to return the current list of backlogged files and echo this to the console (for Shell Script) as well as exit with the errorlevel to be picked up in hostmonitor (For External Program).
This took me bloody ages, because of the %WinDir%\Sysnative part, which allows the 32bit command to access the system32 folder.... which was new to me!
Thought it may be of use to somebody else.
Code: Select all
SET EL=
for /F "tokens=6 delims= " %%A IN ('"%WinDir%\Sysnative\dfsrdiag.exe backlog /rmem:File02 /rgname:Replicationgroup1 /rfname:Foldername /smem:file01"') DO SET EL=%%A & GOTO finish
@echo Should Never Happen
:FINISH
IF %EL%==is SET EL=0
@echo SCRIPTRES:Host is alive:%EL%
EXIT /B %EL%