schedule dfs diagnostic report for all replication groups

Great for for getting all Windows related scripts.

schedule dfs diagnostic report for all replication groups

Postby Praveen » Tue Dec 29, 2009 3:52 pm

Generating diagnostic report for all replication groups are time consuming process. This can be automated by scheduling a VBscript to run the command line dfsradmin utlity.

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
User avatar
Praveen
Site Admin
 
Posts: 90
Joined: Sat Apr 25, 2009 2:21 pm

Re: schedule dfs diagnostic report for all replication groups

Postby Praveen » Wed Dec 30, 2009 11:14 am

if you have very few replication group, then simply create a batch file with the following command
dfsradmin health new /RgName:GroupName /RefMemName:ServerName /repname:c:\DFSReports\GroupName_HealthReport_%date:~-4%-%date:~4,2%-%date:~7,2%.htm /FsCount:true

GroupName - Replication group name
ServerName - Server Name
User avatar
Praveen
Site Admin
 
Posts: 90
Joined: Sat Apr 25, 2009 2:21 pm

DFSRADMIN in Windows Server 2008 - All commands with example

Postby Praveen » Thu May 20, 2010 8:31 am

DFSRADMIN in Windows Server 2008 - All commands with example
You do not have the required permissions to view the files attached to this post.
User avatar
Praveen
Site Admin
 
Posts: 90
Joined: Sat Apr 25, 2009 2:21 pm

DFSRDIAG in Windows Server 2008 - All commands with example

Postby Praveen » Thu May 20, 2010 8:48 am

DFSRDIAG in Windows Server 2008 - All commands with example
You do not have the required permissions to view the files attached to this post.
User avatar
Praveen
Site Admin
 
Posts: 90
Joined: Sat Apr 25, 2009 2:21 pm


Return to Windows Scripting/WMI/VBScript

Who is online

Users browsing this forum: No registered users and 0 guests

cron