Power Shell to Create DFS-R Diagnostic Reports.

Script to generate a new DFS- HTML Health Report and Propagation report for the "Replication Group" using the native dfsradmin.exe tool. http://www.microsoft.com/en-in/download/details.aspx?id=11470


Sample Script

$ReportFilePath = "C:\DFSReports\Propagation-sx.net_vol1_marketing-"+(Get-Date -UFormat %Y-%m-%d)
$ReferralDC = "sx\sbmx01-neerav.sx.net"
#$reportFilePath1 = "C:\Marketing"
$SmtpServer = "sbmx01-neerav.sx.net"
$EmailFrom = "sumeet.kumar@sx.net"
$EmailTo = "testuser3@sx.net"

#Run Dfsradmin.exe to generate Health  Report
DfsrAdmin.exe Health New /RgName:`"sx.net\vol1\marketing`" /RefMemName:$ReferralDC /RepName:$ReportFilePath /FsCount:true

#Run Dfsradmin.exe to generate to generate Propagation test and Report
DfsrAdmin.exe Proptest New /RgName:`"sx.net\vol1\marketing`" /RfName:"Marketing" /MemName:"sx\sbmx01-neerav" /domain:"sx.net"
DfsrAdmin.exe PropRep New /RgName:`"sx.net\vol1\marketing`" /RfName:"Marketing" /MemName:"sx\sbmx01-neerav" /NF:0  /RepName:$ReportFilePath

#Send HTML-report to the specified e-mail address
Send-MailMessage -From $EmailFrom -To $EmailTo -SmtpServer $SmtpServer -Subject "DFS-R Health Report 2010-12-30" -Body "The DFS-R Health Report is attched to this e-mail" -Attachments ($ReportFilePath+".html")

References:  1. http://gallery.technet.microsoft.com/scriptcenter/10ca8b47-b0ec-4910-bdd7-   52ce2d4bca41
2. http://social.technet.microsoft.com/Forums/en/winserverpowershell/thread/60cbfd18-e7ae-44a7-a7da-f83028ef6224
3. http://3cvguy.com/?p=95
4. http://blog.powershell.no/2010/12/30/dfs-r-health-report-for-sysvol/

Comments

Popular posts from this blog

Enterprise CA option is greyed out / unavailable

Rearm the Office 2013 installation

MP has rejected registration request due to failure in client certificate