<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>invurted.com &#187; DFS reporting</title>
	<atom:link href="http://invurted.com/tag/dfs-reporting/feed/" rel="self" type="application/rss+xml" />
	<link>http://invurted.com</link>
	<description>With great virtualisation comes great responsibility!</description>
	<lastBuildDate>Thu, 03 Jun 2010 10:14:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Distributed File Server (DFS) Reporting</title>
		<link>http://invurted.com/distributed-file-server-dfs-reporting/</link>
		<comments>http://invurted.com/distributed-file-server-dfs-reporting/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 03:19:05 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[DFS reporting]]></category>

		<guid isPermaLink="false">http://invurted.com/?p=283</guid>
		<description><![CDATA[Uncovering the secrets of automating DFS reporting]]></description>
			<content:encoded><![CDATA[<p>Well, haven&#8217;t I been out of the loop for a while?! Thankfully, my unemployment lasted nowhere near as long as I would have expected in the harsh economic climate and I am adjusting brilliantly to corporate/enterprise life once again (like there would be any doubt!) <span id="more-283"></span></p>
<p>All bragging aside, I have been working on a Storage Craft disaster recovery (DR) solution combining Vmware and Microsoft Distributed File System. The basic structure is this:</p>
<p>Storagecraft takes snapshots/incremental backups of virtual machines in the existing infrastructure and places them into a folder on it&#8217;s local storage that is then replicated across the WAN to the DR site. The DR site, also a Storagecraft server and also having a standalone ESX 3.5 server, can restore images of these machines with a fifteen minute tolerance of when the machine failed. This is all reliant on the most recent incremental backups being transmitted across the wire successfully.</p>
<p>Of course, as a DR site, the client is extremely interested in as much reporting as possible and this includes DFS. There is a builtin reporting function in DFS that requires manual intervention to trigger. The client requires automated reporting, as you would expect.</p>
<p>After trawling the internet, I found a workable solution combining a script and task scheduling in Windows 2003 R2.</p>
<p>As an aside, there was <a href="http://technet.microsoft.com/en-us/library/cc775480(WS.10).aspx">this</a> handy little reference that I stumbled across as well. Nothing too surprising, but definitely worth thinking about.</p>
<p>The solution for the reporting was a script ripped from:</p>
<p>http://blogs.technet.com/filecab/articles/437214.aspx</p>
<p>and it looks like this:<br />
<code><br />
#######<br />
## REM This script needs to run as a daily scheduled task by someone who has<br />
## REM local administrator rights for all machines in reported RG.  This script<br />
## REM will generate a health report for all members of the replication group,<br />
## REM with backlog based on a specified reference member.  When reports are<br />
## REM complete they will be saved to a specified share.  When ALL reports are<br />
## REM done, mail will be sent to the specified e-mail alias with links to the<br />
## REM share.<br />
#######</p>
<p>@echo off</p>
<p>set CURRDATE=%TEMP%\CURRDATE.TMP<br />
set CURRTIME=%TEMP%\CURRTIME.TMP</p>
<p>DATE /T > %CURRDATE%<br />
TIME /T > %CURRTIME%</p>
<p>######<br />
## REM This adds the date and time to the health report name and to the title<br />
## REM of the e-mail.<br />
######</p>
<p>set PARSEARG="eol=; tokens=1,2,3,4* delims=/, "<br />
for /F %PARSEARG% %%i in (%CURRDATE%) Do SET DDMMYYYY=%%j-%%k-%%l</p>
<p>set PARSEARG="eol=; tokens=1,2,3* delims=:, "<br />
for /F %PARSEARG% %%i in (%CURRTIME%) Do Set HHMM=%%i%%j%%k</p>
<p>#######<br />
## REM Here you define the different resources by specifying the name of each<br />
## REM replication group, server name and share name.  You can do this for as<br />
## REM many replication groups as you want, but keep in mind that the script<br />
## REM will wait until all reports complete before mail is sent out.<br />
#######</p>
<p>set RG1_Report=\\Server_name\Share_Name\RG1_Name-%DDMMYYYY%-%HHMM%.html<br />
set RG2_Report=\\Server_name\Share_Name\RG2_Name-%DDMMYYYY%-%HHMM%.html</p>
<p>@echo on</p>
<p>#######<br />
## REM This generates the reports with Dfsradmin.exe (you can use help to see<br />
## REM what else it can do.)  You need to set the name of the replication<br />
## REM group, the name of the reference server for calculating backlog, the<br />
## REM domain the RG is in, and a name for the report.  The time and date<br />
## REM variables we defined earlier in the script<br />
#######</p>
<p>dfsradmin health new /rgname:RG1 /refmemname:Domain_name\Server_Name /domain:domain_name.com /ReportName:%RG1Report%<br />
dfsradmin health new /rgname:RG2 /refmemname:Domain_name\Server_Name /domain:domain_name.com /ReportName:%RG2Report%</p>
<p>echo RG1  %RG1Report% >  %TEMP%\healthMessageBody.txt<br />
echo RG2  %RG2Report% >> %TEMP%\healthMessageBody.txt</p>
<p>#######<br />
### REM You will need to obtain an email command line application for this<br />
### REM next part.  You will use the program to send an email with links to<br />
### REM the health reports to an alias of your choice.  You may want address<br />
### REM this mail to a distribution group.<br />
### REM<br />
### REM The command below is an example of how to send the mail using a<br />
### REM ficticious command line mail application.  You will need to reformat<br />
### REM the command to be compatible with your command line mail application.<br />
### REM<br />
### REM You many need to give the sending alias the "Send As" right<br />
#######</p>
<p>cl_mail.exe smtp server:my_smtphost to:some_Alias@domain.com from:your_alias@domain.com subject:"DFS Replication Health Reports %DDMMYYYY%" message:@%TEMP%\healthMessageBody.txt auth:sspi<br />
</code></p>
<p>The only potential problems are:</p>
<ul>
<li>The requirement for a command line email utility</li>
<li>Only notification of the report&#8217;s location, not the report itself</li>
<li>Size over time. Each report generated takes about 60KB of disk space.</li>
<li>The format of the report ie. XML/HTML</li>
</ul>
<p>Still, it&#8217;s better than nothing!!</p>
]]></content:encoded>
			<wfw:commentRss>http://invurted.com/distributed-file-server-dfs-reporting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
