- Code: Select all
'#########Script by Praveen Kumar###################
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("./repgroupname.txt", 1) 'input text file for name of the replication group
Do until objFile.AtEndOfStream
Strgroup = objFile.ReadLine
Set objShell = CreateObject("Wscript.Shell")
objShell.Run("%COMSPEC% /c dfsradmin health new /RgName:" & Strgroup & " /RefMemName:ServerName /repname:c:\" & strgroup & "_%date:~-4%-%date:~4,2%-%date:~7,2%.htm /FsCount:true ") ' input the server name and location for saving the files.
WScript.Sleep(30000) 'sleep the vbscript untile the command create the output file. please vary the second as per your requirement.
loop
