{"id":14,"date":"2009-10-24T15:15:05","date_gmt":"2009-10-24T19:15:05","guid":{"rendered":"http:\/\/enterpriseadmins.org\/blog\/?p=14"},"modified":"2009-10-24T15:36:06","modified_gmt":"2009-10-24T19:36:06","slug":"14","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/scripting\/14\/","title":{"rendered":"DFS Replication Report Task"},"content":{"rendered":"<p>This is an earlier piece of code (says 1\/21\/2007). \u00a0I don&#8217;t do a lot with batch files anymore&#8230;however, it looks like this could still work and I thought I&#8217;d copy it here.<\/p>\n<p>Purpose: Create Distributed File System (DFS) Replication Health Reports, post them to a web site and send an email notification when complete. This script was designed to run as a scheduled task.<\/p>\n<p>Tested Windows Version(s): Windows 2003 R2<br \/>\nScript language: standard batch file<\/p>\n<p><code><br \/>\nREM ================================================================================ REM ====================== DFS Replication Report Generation ======================<br \/>\nREM ================================================================================<br \/>\nREM Created by Brian Wuchner on 1\/19\/2007<\/code><\/p>\n<p><code> <\/code><\/p>\n<p><code>SET ReplicationGroup=server1\\web_replication\\webdev<br \/>\nSET DestinationOutputPath=D:\\Inetpub\\wwwroot\\webdev.domain.alias\\ReplicationReport<br \/>\nSET DestinationWebOutput=http:\/\/webdev.domain.alias\/ReplicationReport<br \/>\nSET SendSMTPnotification=yes<\/code><\/p>\n<p><code>REM Optional settings for email notifcation<br \/>\nSET BlatSMTPmailPath=\"D:\\SCRIPT\\BLAT\\blat.exe\"<br \/>\nSET SMTP_Server_Address=smtp_server.com<br \/>\nSET SMTP_From_Address=scripter@domain.alias<br \/>\nSET SMTP_To_Address=scripter@domain.alias<br \/>\n@ECHO OFF<br \/>\nCLS<\/code><\/p>\n<p><code>REM Use the for command to format date and time as YYYY-MM-DD HHMM<br \/>\nfor \/F \"eol=; tokens=1,2,3,4* delims=\/, \" %%i in ('date \/t') do SET YYYYMMDD=%%l-%%j-%%k<br \/>\nfor \/F \"eol=; tokens=1,2,3* delims=:, \" %%i in ('time \/t') do SET HHMM=%%i%%j%%k<\/p>\n<p>DFSRadmin health new \/rgname:%ReplicationGroup% \/repname:\"%DestinationOutputPath%\\%YYYYMMDD%_%HHMM%.html\"<\/p>\n<p><\/code><\/p>\n<p><code>if %SendSMTPnotification%==yes %BlatSMTPmailPath% -server %SMTP_Server_Address% -f %SMTP_From_Address% -to %SMTP_To_Address% -subject \"DFS Replication Report %YYYYMMDD%_%HHMM%\" -body \"The DFS Replication Report for replication group %ReplicationGroup% dated %YYYYMMDD%_%HHMM% has completed and is ready for review. You may access the report here: %DestinationWebOutput%\/%YYYYMMDD%_%HHMM%.html. This report was sent from %computername% by %userdomain%\\%username%.\"<br \/>\nexit<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is an earlier piece of code (says 1\/21\/2007). \u00a0I don&#8217;t do a lot with batch files anymore&#8230;however, it looks like this could still work and I thought I&#8217;d copy it here. Purpose: Create Distributed File System (DFS) Replication Health &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/scripting\/14\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-scripting"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":4,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}