<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Ananth Anto's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/anto_rocks/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/anto_rocks/feed.xml</link>
    <description>The Office AppCompat one-stop-shop</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:06:46 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Demo of ProPlus add-in readiness tools - Office ProPlus Application compatibility</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/demo-of-proplus-add-in-readiness-tools-office-proplus-application-compatibility</link>
      <pubDate>Mon, 29 May 2017 20:48:12 GMT</pubDate>
      <dc:creator><![CDATA[Ananth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/?p=675</guid>
      <description><![CDATA[We know Office add-in application compatibility can be a concern for many enterprises when they are...]]></description>
      <content:encoded><![CDATA[We know Office add-in application compatibility can be a concern for many enterprises when they are planning a ProPlus migration. What I mean by Office add-in compat is that: Enterprises generally depend on Office for their most business-critical processes. Some of these business-critical processes are enabled using either internally developed or third-party add-ins. The concern from some of the Enterprise IT is whether these add-ins would continue to work seamlessly as they migrate from say Office 2010 to Office ProPlus.

In this video, I talk about a tool that we are working towards and which is available in limited public preview pilot program. The idea of sharing this with you is to show you what we are working towards and get feedback. Please watch the video to see a quick demo of the ProPlus Add-in readiness tool. Let us know what you think!

[embed]https://youtu.be/L0sUjDZKNLY[/embed]

&nbsp;

References:

What is Office telemetry dashboard? Please refer to <a href="https://technet.microsoft.com/en-us/library/jj219431.aspx">this article</a>.

What is the Office AppCompat pilot program? How can I sign-up for it? Please refer to <a href="https://techcommunity.microsoft.com/t5/Office-365-ProPlus/New-upgrade-readiness-tools-for-Office-365-ProPlus/td-p/63600">this article</a>.]]></content:encoded>
    </item>
    <item>
      <title>Using Windows Analytics for Office add-in ProPlus readiness</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/using-windows-analytics-for-office-add-in-proplus-readiness</link>
      <pubDate>Mon, 22 May 2017 15:42:04 GMT</pubDate>
      <dc:creator><![CDATA[Ananth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/?p=635</guid>
      <description><![CDATA[[embed]https://www.youtube.com/watch?v=eIQ9D-QRZjo&amp;feature=youtu.be[/embed]

In this video, I...]]></description>
      <content:encoded><![CDATA[[embed]https://www.youtube.com/watch?v=eIQ9D-QRZjo&amp;feature=youtu.be[/embed]

In this video, I talk about how you can use Windows Analytics to evaluate your organization’s ProPlus readiness. Windows Analytics is essentially a way for organizations to see an inventory of their windows applications. Recently we added a capability to Windows analytics which helps it to gather inventory of Office add-ins as well. If your organization is already on Windows analytics, you would be able to see this inventory list of office add-ins. In addition to this, we have also published the ProPlus readiness information of many add-ins.

In this video, I show you how you can combine your organization-specific Office add-in inventory available today in Windows analytics with the ProPlus readiness information is publicly available in an excel. Combining these two sets of data, helps you to identify how ready your organization is for ProPlus.

References:

What is Windows Analytics and how can my organization use it? <a href="https://www.microsoft.com/en-us/windowsforbusiness/windows-analytics">https://www.microsoft.com/en-us/windowsforbusiness/windows-analytics </a>

How do I access the ProPlus readiness information of Office add-ins? <a href="http://aka.ms/addinreadiness">http://aka.ms/addinreadiness</a> For more information on how to use this excel sheet, please refer: <a href="https://techcommunity.microsoft.com/t5/Office-365-ProPlus/Searchable-add-in-list-for-Office-365-ProPlus/m-p/69929#M204">https://techcommunity.microsoft.com/t5/Office-365-ProPlus/Searchable-add-in-list-for-Office-365-ProPlus/m-p/69929#M204</a>]]></content:encoded>
    </item>
    <item>
      <title>Approved Limited Messaging in BingAds</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/approved-limited-messaging-in-bingads</link>
      <pubDate>Fri, 14 Nov 2014 03:42:00 GMT</pubDate>
      <dc:creator><![CDATA[Ananth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2014/11/14/approved-limited-messaging-in-bingads/</guid>
      <description><![CDATA[Why is Approved Limited Messaging changing?
Approved Limited error messaging has been a source of...]]></description>
      <content:encoded><![CDATA[<p><strong><span style="text-decoration: underline;"><span style="font-size: large;">Why is Approved Limited Messaging changing?</span></span></strong></p>
<p>Approved Limited error messaging has been a source of confusion for many advertisers in the past. So what really does it mean to&nbsp;say that a given ad or keyword's delivery status is "Approved Limited"? Approved Limited&nbsp;<em>may actually be good news</em>.&nbsp;It means your item is&nbsp;<em>already approved</em>&nbsp;in at least one of your targeted markets. Read <a href="http://advertise.bingads.microsoft.com/en-us/blogpost/127395/bing-ads-blog/approved-limited-in-bing-ads-the-editor-the-ui-and-you">this article</a> for more details.&nbsp;&nbsp;</p>
<p>So why exactly this &ldquo;Approved Limited&rdquo; status is causing confusion to users? We have heard feedback from Advertisers that&nbsp; sometimes they are getting "Approved Limited" error messages for their ads and keywords for countries/markets that they did not opt into. We have heard about this pain-point and we have fixed it!</p>
<p>&nbsp;</p>
<p><span style="font-size: large;"><strong><span style="text-decoration: underline;">What has changed?</span></strong></span></p>
<p><strong><span style="text-decoration: underline;">Before: </span></strong></p>
<p><strong></strong>Thebehavior of BingAds previously was this: An advertiser creates an ad and targets a particular market say UK. Even though advertiser opts-in to only one market (UK), BingAds was showing him editorial error messages from countries like US, CA even through the advertiser did not opt-in to these countries. This behavior was seen in Bing Ads UI as well as in Bing Ads Editor. This was causing&nbsp; confusion to the advertiser. See screenshots below:</p>
<p><span style="text-decoration: underline;">In Bing Ads WebUI:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/6232.1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/6232.1.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/6232.1.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/6232.1.jpg" alt="" border="0" /></a></p>
<p><br /><span style="text-decoration: underline;">Bing Ads Editor:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/8662.2-2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/8662.2_2D00_2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/8662.2-2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/8662.2_2D00_2.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">After: </span></strong></p>
<p>After this fix, BingAds will show editorial error&nbsp;messages only for those markets to which the advertiser has explicitly targeted to. For eg, in the above example, if the advertiser has opted-in to UK alone, only if there are editorial rejections for UK, the advertiser will be seeing it&nbsp; in WebUI and Bing Ads editor. In the below examples, since the gambling ad was approved in UK (which was the only market the advertiser has opted-in to), the ad is shown as approved.</p>
<p><span style="text-decoration: underline;">In Bing Ads WebUI:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/4478.3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/4478.3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/4478.3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/4478.3.png" alt="" border="0" /></a><strong></strong></p>
<p>&nbsp;</p>
<p>&nbsp;<span style="text-decoration: underline;">Bing Ads Editor:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/7181.4.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/7181.4.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/41/67/7181.4.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-00-41-67/7181.4.jpg" alt="" border="0" /></a><strong></strong></p>
<p>&nbsp;</p>
<p>We hope that with this false alarm gone, advertisers can spend time on optimizing the campaigns so that they can leverage the full power of BingAds.&nbsp;&nbsp;Now, it&rsquo;s your turn! Have you seen these changes in&nbsp;Bing Ads or Bing Ads editor? What do you think? Are you facing any other issue while using Bing Ads? Plz let us know in the comments section.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>All about DHCP Auditing</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/all-about-dhcp-auditing</link>
      <pubDate>Thu, 02 Nov 2006 01:07:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2006/11/02/all-about-dhcp-auditing/</guid>
      <description><![CDATA[In this post, I would be discussing about DHCP Audit logging and how to tweak it to your specific...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>In this post, I would be discussing about DHCP Audit logging and how to tweak it to your specific situation. DHCP Audit logging can be customized using the following parameters:</FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>1)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>The directory path in which the DHCP service stores audit log files: </FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>2)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>A maximum size restriction (in MB) for the total amount of disk space available for all the audit log files created and stored by the DHCP service.</FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>3)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>An interval for disk checking that is used to determine how many times the DHCP server writes audit log events to the log file before checking for available disk space on the server.</FONT></FONT></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>4)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>A minimum size requirement (in MB) for server disk space that is used during disk checking to determine if sufficient space exists for the server to continue audit logging.</FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT size=3><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>In Win2K3, only parameter 1 (i.e. DHCP Audit file path) can be configured through netsh and mmc (Using the command netsh dhcp server set auditlog). The other parameters cannot be configured neither through MMC nor netsh. To set them, we need to set some registry keys:</FONT></FONT></P>
<P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo2"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>1)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>To set the Maximum file size: You need to set the following key. </FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Name: HKLM\SYSTEM\CurrentControlSet\Services\DhcpServer\Parameters\</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>DhcpLogFilesMaxSize </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Type: REG_DWORD </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Value range: 0x0–0xFFFFFFFF MB </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Description:</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Specifies the maximum combined size of one week's worth of Dynamic Host Configuration Protocol (DHCP) audit logs. If the audit logs exceed the size specified by this value, DHCP stops writing to the audit log until sufficient space becomes available.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><A href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/46691.mspx?mfr=true" mce_href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/46691.mspx?mfr=true"><FONT face="Times New Roman" color=#800080 size=3>http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/46691.mspx?mfr=true</FONT></A><FONT face="Times New Roman" size=3> </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo2"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>2)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>To set the Disk Check interval: You need to set the following key.</FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Name: HKLM\SYSTEM\CurrentControlSet\Services\DhcpServer\Parameters\DhcpLogDiskSpaceCheckInterval</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Type: REG_DWORD </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Value range: 0x0–0xFFFFFFFF number of audit log entries</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Description:</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Determines how often Dynamic Host Configuration Protocol (DHCP) verifies that disk space and file size are adequate for its audit log. The value of this entry represents the number of audit log records entered between each verification check.</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><A href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/46691.mspx?mfr=true" mce_href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/46691.mspx?mfr=true"><FONT face="Times New Roman" color=#800080 size=3>http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/46691.mspx?mfr=true</FONT></A><FONT face="Times New Roman" size=3> </FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo2"><FONT face="Times New Roman"><SPAN style="mso-list: Ignore"><FONT size=3>3)</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><FONT size=3>To set the minimum disk space: You need to set the following key.</FONT></FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Name: HKLM\SYSTEM\CurrentControlSet\Services\DhcpServer\Parameters\DhcpLogMinSpaceOnDisk</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Type: REG_DWORD</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Key Value: 0x0–0xFFFFFFFF MB</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Description:</FONT></P>
<P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in"><FONT face="Times New Roman" size=3>Specifies the minimum amount of free disk space required for audit logging.The Dynamic Host Configuration Protocol (DHCP) periodically verifies that it has sufficient disk space to proceed with audit logging (the interval is specified in the value of the DhcpLogDiskSpaceCheckInterval entry). This entry specifies the minimum value that DHCP requires. If the amount of free disk space is less than the value of this entry, then the DHCP service does not write to the audit log. Logging is suspended until sufficient disk space is available.</FONT></P>
<P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 0pt 0.5in"><A href="http://technet2.microsoft.com/WindowsServer/en/library/f7802dce-3ff9-406a-b3e6-c0c6b3ed49411033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/WindowsServer/en/library/f7802dce-3ff9-406a-b3e6-c0c6b3ed49411033.mspx?mfr=true"><FONT face="Times New Roman" color=#800080 size=3>http://technet2.microsoft.com/WindowsServer/en/library/f7802dce-3ff9-406a-b3e6-c0c6b3ed49411033.mspx?mfr=true</FONT></A><FONT face="Times New Roman" size=3> </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;In Longhorn Server, all the above functionality is exposed in the command netsh dhcp server set auditlog.</FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>One more specific information I want to include in this post is about the delete policy of the DHCP Server with respect to old audit log files. The DHCP server does its auditing for a given day in a file corresponding to the day. For example, if the current day is wednesday, then it audit logs that day's events into the wednesday file. Like this for every day in the week, there is a audit log file. At 12:00 A.M. local time on the server computer, the DHCP server closes the existing log and moves to the log file for the next day of the week. For example, if the day of the week changes at 12:00 A.M. from Wednesday to Thursday, the log file named DhcpSrvLog-Wed.log is closed and the file named DhcpSrvLog-Thu.log is opened and used for logging events. </FONT></o:p><o:p><FONT face="Times New Roman" size=3>When the DHCP server starts or whenever a new day of the week occurs (when local time on the computer is 12:00 A.M.), the server writes a header message in the audit log file, indicating that logging started. Depending on whether the audit log file is a new or existing file, the following actions occur next:<BR>• If the audit log file has existed without modification for more than 24 hours, <STRONG>it is overwritten.</STRONG><BR>• If the file has existed but was modified within the previous 24 hours, the file is not overwritten. New logging activity is appended to the existing file. </FONT></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>So if you want to make sure that your audit log files are appended and not overwritten, they must be changed in the last 24 hours. Let's say today is tuesday, and you want that auditing for tomorrow needs to be appended to last week's activity(and not overwritten), then you must edit the file DhcpLog-Wed.log. </FONT><BR style="mso-special-character: line-break"></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>For further information on DHCP Auditing, please refer: <A href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/cnet/cncb_dhc_tmvc.mspx?mfr=true" mce_href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/cnet/cncb_dhc_tmvc.mspx?mfr=true">http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/cnet/cncb_dhc_tmvc.mspx?mfr=true</A></FONT></o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>RManager - A tool to manage reservations</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/rmanager-a-tool-to-manage-reservations</link>
      <pubDate>Wed, 23 Aug 2006 10:10:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2006/08/23/rmanager-a-tool-to-manage-reservations/</guid>
      <description><![CDATA[Reservation Manager:Reservations&nbsp;are a critical feature in the DHCP server. Reservations’ are...]]></description>
      <content:encoded><![CDATA[<P><STRONG><FONT size=4>Reservation Manager:</FONT></STRONG><BR>Reservations&nbsp;are a critical feature in the DHCP server. Reservations’ are generally used for centralized static IP address assignment for critical machines. This way the IP address of the critical machines which serves critical functions in the network will not have dynamically assigned IP address which can change over time. The reservation manager is a tool which will help solve typical reservation-related problems which the network admins might face. More often than not this tool tries to automate problems to recurring customer problems. It tries to solve the following reservation-related problems:<BR><STRONG>1) Migrating reservations from one DHCP Server to another on specific subnets.</STRONG><BR>As a general best-practice, reservations must be duplicated across all DHCP servers serving the same subnet. This particular functionality addresses this best-practice. Without this the admin has to manually dump reservations from one server to another. This command takes 3+ arguments. The first argument tells the destination DHCP server IP address to which the reservations must be copied to. The second argument identifies the IP Address of the source DHCP server. The last argument is either ‘all’ or identifies the first scope address on which this operation has to be performed. The third argument can be followed by n number of arguments which identify the different subnet’s to which this operation has to be performed.<BR>Example:<BR>cscript rmanager.vbs Rmanager –migrate 10.0.0.1 11.0.0.1 all<BR>This command will copy all reservations in all scopes from the server 10.0.0.1 to the server 11.0.0.1.<BR>cscript rmanager.vbs Rmanager –migrate 10.0.0.1 11.0.0.1 12.0.0.0 10.0.0.0 11.0.0.0<BR>This command will copy reservations from the scopes 12.0.0.0 10.0.0.0 and 11.0.0.0 from the server 10.0.0.1 to 11.0.0.1.<BR>For this command to work properly the specified scope/scopes should be present in both the servers. An error message will be printed for those scopes for which this condition is not met. Also for those reservations which cannot be added successfully for whatever reason, an error is printed. Also for every successfully migrated reservation, it can be printed.<BR>In addition to this, this command can also take an additional preview switch which will just print the action which will be taken and not actually take the action. This is especially useful when the admin wants to review the action before doing it.<BR>Example:<BR>cscript rmanager.vbs Rmanager –migrate 10.0.0.1 11.0.0.1 all –preview out.txt<BR>cscript rmanager.vbs Rmanager –migrate 10.0.0.1 11.0.0.1 12.0.0.0 10.0.0.0 11.0.0.0 –preview out.txt</P>
<P><STRONG>2) Synchronizing reservations on 2 DHCP servers on specific subnets.</STRONG><BR>As already mentioned, it is a general best-practice for reservations must be duplicated across all DHCP servers serving the same subnet. This particular functionality addresses this best-practice in a more subter way. Instead of copying reservations from one server to another, this option lets the admin to synchronize the reservation lists between two servers. The arguments for this switch is exactly similar to that of the migrate switch. This command also has an optional preview switch.<BR>Example:<BR>cscript rmanager.vbs&nbsp;Rmanager –sync 10.0.0.1 11.0.0.1 all<BR>This command will sync all reservations in all scopes from the server 11.0.0.1 to the server 10.0.0.1.<BR>cscript rmanager.vbs Rmanager –sync 10.0.0.1 11.0.0.1 12.0.0.0 10.0.0.0 11.0.0.0<BR>For this command to work properly the specified scope/scopes should be present in both the servers. An error message will be printed for those scopes for which this condition is not met. Also for those reservations which cannot be added successfully for whatever reason, an error is printed. Also for every successfully migrated reservation, it can be printed.<BR>In addition to this, this command can also take an additional preview switch which will just print the action which will be taken and not actually take the action. This is especially useful when the admin wants to review the action before doing it.<BR>Example:<BR>cscript rmanager.vbs Rmanager –sync 10.0.0.1 11.0.0.1 all –preview out.txt<BR>cscript rmanager.vbs Rmanager –sync 10.0.0.1 11.0.0.1 12.0.0.0 10.0.0.0 11.0.0.0 –preview out.txt</P>
<P><STRONG>3) Dumping leases on specific subnets.</STRONG><BR>This command dumps the leases for a specific scope and server into a human-editable text file. The file will contains several lines each of which corresponds to a single lease. A lease is represented by IP address and MAC address. The exact utility of this command will be exposed once you see the next section.<BR>Example:<BR>cscript rmanager.vbs Rmanager -dumplease out.txt 120.0.0.1 all<BR>The above command dumps all leases in all scopes in the server 120.0.0.1 to a text file called "out.txt"<BR>cscript rmanager.vbs Rmanager -dumplease out.txt 120.0.0.1 10.0.0.0 11.0.0.0<BR>The above command dumps all leases in scopes 10.0.0.0 and 11.0.0.0 in the server 120.0.0.1 to a text file called "out.txt"</P>
<P><STRONG>4) MakeReservation switch.</STRONG><BR>This switch tries to create reservations on a given DHCP server from the information present in a given input file. The input file contains several lines of info. Each line corresponds to a single reservation. Each reservation is represented by IP address and MAC address pair. The format of this input file is exactly the same as the output file of the -dumplease switch.<BR>Example:<BR>cscript rmanager.vbs Rmanager -makereservation 120.0.0.1 out.txt<BR>This command will create reservations out of information present in the file out.txt in the server 120.0.0.1. </P>
<P>Based on the -dumplease and -makereservation switch, some interesting possibilities arise. What is possible is the following scenario: An admin has an active DHCP server which has a couple of scopes. Initially there are no reservations in any of these scopes. Thus all the subnets corresponding to these scopes have dynamic addresses. In the environment any machine which is plugged into the these subnets will get a dynamic IP address from the DHCP server. Now to restrict the access of the network to those machines that are already connected to the network, the admin can do the following. <BR>cscript rmanager.vbs Rmanager -dumplease out.txt 120.0.0.1 all<BR>cscript rmanager.vbs Rmanager -makereservation 120.0.0.1 out.txt<BR>These two commands intends to convert every active lease in a given DHCP server identified by an IP address in a given set of scopes identified by a list of scope addresses into reservations. Once this is done, the admin also has to make sure that the whole address space in the given scope in the DHCP server are excluded. This operation is thus particularly relevant to those admins who might want to move from a pure Dynamic IP address assignment to a more controlled purely reservation oriented address assignment. This way the admin can keep track of who is getting IP addresses and can limit the network access to those clients who already have an IP address.<BR>The first command Rmanager -dumplease &lt;filename&gt; &lt;Scope Identifiers&gt; will dump all the active leases in the specified server and scope to a text file. This text file will have pair of IP address and MAC addresses. The second command Rmanager –makereservation &lt;ServerIdentifier&gt; &lt;filename&gt; will take the file which is generated by the first command and create reservations corresponding to them. The idea behind separating these two actions is to make sure that the admin gets a chance to edit the file generated by the first command before proceeding to the second. Also we want to support scenarios where the admin can just create the file and use it to run the second command directly.</P>
<P><EM>In the attachment (See the link at the end of this post), Find the RManager.vbs .You need to extract the contents of the zip file into a separate folder and run it from there. The zip file should contain two files: rmanager.vbs and help.txt.</EM></P>
<P><EM>&nbsp;If you are not able to get it, Cut-copy-paste the following into a file named rmanager.vbs. Also copy the contents of the documentation help.txt</EM></P>
<P>Run it by typing "cscript rmanager.vbs"</P>
<P>X-----------------------Begin Paste---------------------X</P>
<P>call start()<BR>dim scopes<BR>dim synccount<BR>dim argerror<BR>dim iparray<BR>dim macarray<BR>dim finaliparray<BR>dim finalmacarray<BR>dim m<BR>dim args</P>
<P>sub start()<BR>&nbsp;<BR>&nbsp;args=0&nbsp;<BR>&nbsp;synccount=0<BR>&nbsp;argerror=0<BR>&nbsp;if(wscript.arguments.count=0) then<BR>&nbsp;wscript.echo "enter the command"<BR>&nbsp;exit sub<BR>&nbsp;end if</P>
<P>&nbsp;for i=0 to wscript.arguments.count-1<BR>&nbsp;if(i=0) then<BR>&nbsp;str=wscript.arguments.item(i)<BR>&nbsp;else<BR>&nbsp;str=str&amp;" "&amp;wscript.arguments.item(i)<BR>&nbsp;end if&nbsp;<BR>&nbsp;next<BR>&nbsp;<BR>&nbsp;str1=split(str)</P>
<P>&nbsp;'show error if nothing is entered------------</P>
<P>&nbsp;if (not isarray(str1)) then<BR>&nbsp;wscript.echo "Error: unrecongnized or incomplete command line."<BR>&nbsp;call helpfile()<BR>&nbsp;exit sub<BR>&nbsp;end if</P>
<P><BR>&nbsp;'checking if the command is Rmanager or not</P>
<P>&nbsp;if(strcomp("Rmanager",str1(0))&lt;&gt;0) then<BR>&nbsp;wscript.echo "Error: unrecongnized or incomplete command line."<BR>&nbsp;call helpfile()<BR>&nbsp;exit sub<BR>&nbsp;end if<BR>&nbsp;&nbsp;<BR>&nbsp;'checking for different cases after Rmanager<BR>&nbsp;if(ubound(str1)=0) then<BR>&nbsp;wscript.echo "Error: unrecongnized or incomplete command line."<BR>&nbsp;call helpfile()<BR>&nbsp;exit sub<BR>&nbsp;end if<BR>&nbsp;select case str1(1)</P>
<P>&nbsp;case "-migrate"</P>
<P>&nbsp;&nbsp;call migrate(str1)<BR>&nbsp;&nbsp;<BR>&nbsp;case "-sync"<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;call migrate(str1)<BR>&nbsp;&nbsp;if(argerror=1) then<BR>&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;synccount=1<BR>&nbsp;&nbsp;a=str1(2)<BR>&nbsp;&nbsp;str1(2)=str1(3)<BR>&nbsp;&nbsp;str1(3)=a<BR>&nbsp;&nbsp;call migrate(str1)&nbsp;</P>
<P>&nbsp;case "-dumplease"<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;call dump(str1)<BR>&nbsp;&nbsp;<BR>&nbsp;case "-makereservation"</P>
<P>&nbsp;&nbsp;call makereservation(str1)<BR>&nbsp;<BR>&nbsp;case "/?"<BR>&nbsp;<BR>&nbsp;&nbsp;call helpfile()<BR>&nbsp;&nbsp;<BR>&nbsp;case else<BR>&nbsp;&nbsp;wscript.echo "Error: unrecongnized or incomplete command line."<BR>&nbsp;&nbsp;call helpfile()<BR>&nbsp;<BR>&nbsp;&nbsp;end select<BR>&nbsp;<BR>'delete the scopefile that is created during the program&nbsp;</P>
<P>set fso = createobject("Scripting.FileSystemObject")<BR>if(fso.fileexists("scopefile.txt"))then<BR>fso.deletefile("scopefile.txt"),true<BR>end if</P>
<P><BR>end sub</P>
<P><BR>' function for dumplease</P>
<P>sub dump(str1)</P>
<P>'if improper arguments are entered show error</P>
<P>if ubound(str1)&lt;4 then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>wscript.echo "Error: unrecongnized or incomplete command line."<BR>call helpfile()<BR>exit sub<BR>end if</P>
<P>filename = str1(2)<BR>set fso = createobject("Scripting.FileSystemObject")<BR>&nbsp;Set outfile = fso.CreateTextFile(filename)<BR>&nbsp;outfile.close</P>
<P>p=checkserver(str1(3))</P>
<P>if p=0 then<BR>wscript.echo "server "&amp;str1(3)&amp;" not present or is entered wrongly"<BR>exit sub<BR>end if</P>
<P>serverarray = makescopearray(scopes)</P>
<P>if not isarray(serverarray) then<BR>wscript.echo "no scopes in server "&amp;str1(3)<BR>exit sub<BR>end if</P>
<P>if (strcomp(str1(4),"all")=0) then </P>
<P>&nbsp;if(ubound(str1)=4) then<BR>&nbsp;scope = serverarray<BR>&nbsp;else<BR>&nbsp;wscript.echo "improper arguments"<BR>&nbsp;end if</P>
<P>else</P>
<P>for i = 4 to ubound(str1)<BR>if(isscope(str1(i),serverarray)) then<BR>redim preserve scope(i-4)<BR>scope(i-4)=str1(i)<BR>else<BR>wscript.echo "scope "&amp; str1(i) &amp;" is not present in server "&amp;str1(3)<BR>exit sub<BR>end if<BR>next<BR>end if<BR>'scope contains all the scopes entered<BR>if not isarray(scope) then<BR>wscript.echo "no scopes in the server "&amp;str1(3)<BR>else<BR>if scope(0)="" then<BR>wscript.echo "no scopes in the server "&amp;str1(3)<BR>else<BR>&nbsp;set wshell = CreateObject("WScript.Shell") <BR>&nbsp;<BR>&nbsp;for i = 0 to ubound(scope)<BR>&nbsp;set obj = wshell.exec("netsh dhcp server "&amp;str1(3)&amp;" scope "&amp;scope(i)&amp;" show clients")<BR>&nbsp;clients = obj.stdout.readall()<BR>&nbsp;if(instrrev(clients,"Command completed successfully.")=0) then<BR>&nbsp;exit sub<BR>&nbsp;end if&nbsp;<BR>&nbsp;call makeclients(clients,str1(2))&nbsp;<BR>&nbsp;next<BR>end if<BR>end if<BR>if args = 0 then<BR>else<BR>wscript.echo "the ipaddress and macaddress pair are in file "&amp;filename<BR>end if<BR>end sub</P>
<P>'the following procedure outputs the ip and corresponding mac addresses(active leases) into the file - 'filename'...it takes the output string clients that we get after executing the command shoe clients</P>
<P>sub makeclients(clients,filename)</P>
<P>&nbsp;set fso = createobject("Scripting.FileSystemObject")<BR>&nbsp;Set scopefile = fso.CreateTextFile("scopefile.txt")<BR>&nbsp;scopefile.writeline(clients)<BR>&nbsp;scopefile.close<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;Set scopefile = fso.OpenTextFile("scopefile.txt")<BR>&nbsp;&nbsp;&nbsp;do While not scopefile.AtEndOfStream&nbsp;&nbsp;&nbsp;'reading line by line and checking for the string "Total No. of Scopes"<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp; &nbsp;&nbsp;line = scopefile.ReadLine<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if(instr(line,"No of Clients")=1) then&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;str = split(line)<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;t=str(4)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;'taking no. of clients into t<BR>&nbsp;&nbsp;&nbsp;exit do<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;end if</P>
<P>&nbsp;&nbsp;&nbsp;loop&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;scopefile.close<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;t=cint(t)&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;if t=0 then<BR>&nbsp;&nbsp;&nbsp;wscript.echo "no clients in the scope "&amp;str(ubound(str))<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;&nbsp;end if<BR>args=args+1<BR>Set scopefile = fso.OpenTextFile("scopefile.txt")<BR>for i= 1 to 8<BR>scopefile.skipline<BR>next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>set outfile = fso.opentextfile(filename,8)</P>
<P>for i=0 to t-1<BR>line=scopefile.readline</P>
<P>str= split(line)</P>
<P>if (instr(line,"INACTIVE")&lt;&gt;0) then<BR>d=0<BR>&nbsp;for l=0 to ubound(str)<BR>&nbsp;if(str(l)="") then<BR>&nbsp;else<BR>&nbsp;if d=3 then <BR>&nbsp;exit for<BR>&nbsp;else<BR>&nbsp;d=d+1&nbsp;<BR>&nbsp;end if<BR>&nbsp;end if<BR>&nbsp;next<BR>&nbsp;<BR>outfile.write(str(0))<BR>for size = 1 to 18-(len(str(0)))<BR>outfile.write(" ")<BR>next </P>
<P>outfile.writeline(trim(replace(str(l),"-","")))</P>
<P>else<BR>d=0<BR>&nbsp;for l=0 to ubound(str)<BR>&nbsp;if(str(l)="") then<BR>&nbsp;else<BR>&nbsp;if d=4 then <BR>&nbsp;exit for<BR>&nbsp;else<BR>&nbsp;d=d+1&nbsp;<BR>&nbsp;end if<BR>&nbsp;end if<BR>&nbsp;next<BR>outfile.write(str(0))<BR>for size = 1 to 18-(len(str(0)))<BR>outfile.write(" ")<BR>next </P>
<P>outfile.writeline(trim(replace(str(l),"-","")))</P>
<P><BR>end if<BR>next<BR>outfile.close<BR>end sub</P>
<P>sub makereservation(str1)</P>
<P>if ubound(str1)&lt;&gt;3 then<BR>wscript.echo "Error: unrecongnized or incomplete command line."<BR>call helpfile()<BR>exit sub<BR>end if </P>
<P>server = str1(2)<BR>filename = str1(3)</P>
<P>set fso = createobject("Scripting.FileSystemObject")<BR>if(not fso.fileexists(filename))then<BR>wscript.echo "file "&amp;filename&amp;" not present"<BR>exit sub<BR>end if</P>
<P>k = checkserver(server)<BR>if k=0 then<BR>wscript.echo "server "&amp;server&amp;" is not present or may have been entered wrongly"<BR>exit sub<BR>end if</P>
<P>scopearray=makescopearray(scopes)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'scopes is the output string obtained after executing show scope command for given server</P>
<P>set handle = fso.opentextfile(filename)</P>
<P>Dim ipaddress <BR>Dim macaddress <BR>t=0<BR>do while not handle.atendofstream</P>
<P>&nbsp;line=trim(handle.readline)<BR>&nbsp;line=replace(line,"&nbsp;","")&nbsp;<BR>&nbsp;if line="" then <BR>&nbsp;<BR>&nbsp;else<BR>&nbsp;&nbsp;strarray=split(line)</P>
<P>&nbsp;&nbsp;p=0</P>
<P>&nbsp;&nbsp;for k=0 to ubound(strarray)<BR>&nbsp;&nbsp;&nbsp;if strarray(k)="" then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;else</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;if p=0 then&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ipaddress=trim(strarray(k))<BR>&nbsp;&nbsp;&nbsp;&nbsp;else if p=1 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;macaddress = trim(strarray(k))<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;p=p+1<BR>&nbsp;&nbsp;&nbsp;&nbsp;'wscript.echo Replace(ipaddress, "&nbsp;", "")<BR>&nbsp;&nbsp;&nbsp;&nbsp;'wscript.echo macaddress<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;next<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;if p&lt;&gt;2 then<BR>&nbsp;&nbsp;wscript.echo "improper format of file"<BR>&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;end if<BR>&nbsp;<BR>&nbsp;redim preserve iparray3(t)<BR>&nbsp;redim preserve macarray3(t)<BR>&nbsp;iparray3(t)=ipaddress<BR>&nbsp;macarray3(t)=macaddress<BR>&nbsp;t=t+1<BR>&nbsp;end if<BR>&nbsp;</P>
<P>loop<BR>handle.close</P>
<P>if not isarray(iparray3) then<BR>wscript.echo "there is nothing in the file"<BR>exit sub<BR>end if</P>
<P>dim arr<BR>redim arr(t-1)<BR>&nbsp;<BR>for i = 0 to ubound(scopearray)<BR>&nbsp;<BR>set iprange = fso.createtextfile("iprangefile.txt")<BR>iprange.close<BR>arraysize = 0<BR>dim iparray1<BR>redim iparray1(0)<BR>redim macarray1(0)</P>
<P>&nbsp;&nbsp;set wshell = CreateObject("WScript.Shell") <BR>&nbsp;set obj = wshell.exec("netsh dhcp server "&amp;server&amp;" scope "&amp;scopearray(i)&amp;" show iprange")<BR>&nbsp;range = obj.stdout.readall()<BR>&nbsp;<BR>&nbsp;set iprange = fso.opentextfile("iprangefile.txt",8)<BR>&nbsp;iprange.writeline(range)<BR>&nbsp;iprange.close<BR>&nbsp;set iprange = fso.opentextfile("iprangefile.txt")<BR>&nbsp;<BR>&nbsp;for p=0 to 5 <BR>&nbsp;iprange.skipline<BR>&nbsp;next<BR>&nbsp;line1=iprange.readline<BR>&nbsp;line2=split(line1)<BR>&nbsp;<BR>&nbsp;count=0<BR>&nbsp;<BR>&nbsp;for j=0 to t-1<BR>&nbsp;<BR>&nbsp;k = checkiprange(line2(3),line2(13),iparray3(j))<BR>&nbsp;<BR>&nbsp;if k = 1 then<BR>&nbsp;<BR>&nbsp;redim preserve iparray1(arraysize)<BR>&nbsp;redim preserve macarray1(arraysize)<BR>&nbsp;iparray1(arraysize) = iparray3(j)<BR>&nbsp;macarray1(arraysize) = macarray3(j)&nbsp;<BR>&nbsp;arraysize = arraysize + 1<BR>&nbsp;arr(j)=1<BR>&nbsp;else if k=2 then<BR>&nbsp;wscript.echo "the ip address "&amp;iparray3(j)&amp;" is not valid"&nbsp;<BR>&nbsp;fso.deletefile("iprangefile.txt"),true<BR>&nbsp;exit sub<BR>&nbsp;end if&nbsp;<BR>&nbsp;end if<BR>&nbsp;next&nbsp;</P>
<P>iprange.close</P>
<P><BR>if isarray(iparray1) and not iparray1(0)="" then</P>
<P>call addreservation(server,scopearray(i),iparray1,macarray1)&nbsp;</P>
<P>if (finaliparray(0)="") then</P>
<P>else<BR>for l=0 to ubound(finaliparray)<BR>set obj = wshell.exec("netsh dhcp server "&amp;server&amp;" scope " &amp;scopearray(i)&amp; " add reservedip "&amp;finaliparray(l)&amp;" "&amp;finalmacarray(l) )<BR>outp = &nbsp;obj.stdout.readall()<BR>&nbsp;&nbsp;if(instr(outp,"Command completed successfully.")&lt;&gt;0) then<BR>&nbsp;&nbsp;wscript.echo "added reservation "&amp;finaliparray(l)&amp; " "&amp;finalmacarray(l)&amp;" to server "&amp;server&amp;" in scope "&amp;scopearray(i)<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;wscript.echo "The specified IP address "&amp;finaliparray(l)&amp; " or hardware address "&amp; finalmacarray(l)&amp; " is either not proper or is being used by another client."<BR>&nbsp;&nbsp;end if<BR>next<BR>end if</P>
<P>end if<BR>redim iparray1(0)<BR>redim macarray1(0)</P>
<P>next</P>
<P>set handle = fso.opentextfile(filename)<BR>for i=0 to ubound(arr)<BR>str=trim(handle.readline)</P>
<P>if(arr(i)=0) then<BR>line=split(str)</P>
<P>wscript.echo "The ipaddress "&amp;iparray3(i)&amp;" is not present in any scope"<BR>end if<BR>next<BR>handle.close<BR>fso.deletefile("iprangefile.txt"),true<BR>end sub</P>
<P>sub addreservation(server,scopestr,iparraysource,macarraysource)</P>
<P>&nbsp;redim finaliparray(0)<BR>&nbsp;redim finalmacarray(0)<BR>&nbsp;set wshell = CreateObject("WScript.Shell") <BR>&nbsp;set obj = wshell.exec("netsh dhcp server "&amp;server&amp;" scope " &amp;scopestr&amp; " show reservedip" )<BR>&nbsp;outpdest = obj.stdout.readall()</P>
<P>&nbsp;call makeipandmacarray(outpdest)<BR>&nbsp;iparraydest = iparray<BR>&nbsp;macarraydest = macarray&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;' remove common ip and mac pair between the two servers for the given scope<BR>&nbsp;<BR>&nbsp;if(not isarray(iparraydest)) then<BR>&nbsp;&nbsp;finaliparray=iparraysource&nbsp;<BR>&nbsp;&nbsp;finalmacarray=macarraysource&nbsp;<BR>&nbsp;<BR>&nbsp;else<BR>&nbsp;&nbsp;k=0<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;for i = 0 to ubound(iparraysource)<BR>&nbsp;&nbsp;flag=0<BR>&nbsp;&nbsp;&nbsp;for j=0 to ubound(iparraydest)<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(iparraysource(i)=iparraydest(j) and macarraysource(i)=macarraydest(j)) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;flag=1<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit for<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;next<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;if flag=1 then<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if synccount = 0 and m=0 then<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;wscript.echo "reservation "&amp;iparraysource(i)&amp;" "&amp;macarraysource(i)&amp;" is already present on server "&amp;server<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;redim preserve finaliparray(k)&nbsp;<BR>&nbsp;&nbsp;redim preserve finalmacarray(k)<BR>&nbsp;&nbsp;finaliparray(k)=iparraysource(i)<BR>&nbsp;&nbsp;finalmacarray(k)=macarraysource(i)&nbsp;<BR>&nbsp;&nbsp;k=k+1&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;next<BR>&nbsp;end if</P>
<P>end sub</P>
<P>function checkiprange(ip1,ip2,ip3)</P>
<P>str2=split(ip1,".")<BR>str3=split(ip2,".")<BR>str4=split(ip3,".")<BR>if ubound(str4)&lt;&gt;3 then<BR>checkiprange=2<BR>exit function<BR>end if</P>
<P>dim string</P>
<P>if cint(str2(0))&lt;=cint(str4(0)) and cint(str4(0))&lt;=cint(str3(0)) then<BR>&nbsp;if cint(str2(1))&lt;=cint(str4(1)) and cint(str4(1))&lt;=cint(str3(1)) then<BR>&nbsp;&nbsp;for i=2 to 3<BR>if(cint(str2(i))&gt;=0 and cint(str2(i))&lt;10) then<BR>string1=string1&amp;"00"&amp;str2(i)<BR>else if(cint(str2(i))&gt;=10 and cint(str2(i))&lt;100) then<BR>string1=string1&amp;"0"&amp;str2(i)<BR>end if<BR>end if<BR>next<BR>for i=2 to 3<BR>if(cint(str3(i))&gt;=0 and cint(str3(i))&lt;10) then<BR>string2=string2&amp;"00"&amp;str3(i)<BR>else if(cint(str3(i))&gt;=10 and cint(str3(i))&lt;100) then<BR>string2=string2&amp;"0"&amp;str3(i)<BR>end if<BR>end if<BR>next</P>
<P><BR>for i=2 to 3<BR>if(cint(str4(i))&gt;=0 and cint(str4(i))&lt;10) then<BR>string3=string3&amp;"00"&amp;str4(i)<BR>else if(cint(str4(i))&gt;=10 and cint(str4(i))&lt;100) then<BR>string3=string3&amp;"0"&amp;str4(i)<BR>end if<BR>end if<BR>next</P>
<P>if(cint(string1)&lt;=cint(string3) and cint(string3)&lt;=cint(string2)) then<BR>checkiprange=1<BR>else<BR>checkiprange=0<BR>end if</P>
<P>&nbsp;else<BR>&nbsp;checkiprange=0<BR>&nbsp;end if<BR>else<BR>checkiprange=0<BR>end if<BR>end function</P>
<P>sub helpfile()</P>
<P>set fso = createobject("Scripting.FileSystemObject")<BR>set help = fso.OpenTextFile("help.txt")</P>
<P>do while not help.atendofstream</P>
<P>wscript.echo (help.readline)</P>
<P>loop</P>
<P>end sub</P>
<P>' this function will return 1 if the scope(scopestr) is present in the given server(serverarray....this is an array of server scopes)(be it source or destination)...else 0</P>
<P>function isscope(scopestr,serverarray)</P>
<P>l=0<BR>for i=0 to ubound(serverarray)<BR>if(strcomp(scopestr,serverarray(i))=0) then<BR>l=1<BR>exit for<BR>end if<BR>next</P>
<P>isscope=l</P>
<P>end function</P>
<P>'this function will check if the server entered as argument is present or not(or rather entered correctly or not)</P>
<P>function checkserver(str1)<BR>dim wshell</P>
<P>dim pos1</P>
<P>&nbsp;set wshell = CreateObject("WScript.Shell") <BR>&nbsp;set obj = wshell.exec("netsh dhcp server "&amp;str1&amp;" show scope")<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;scopes = obj.stdout.readall()<BR>&nbsp;<BR>&nbsp;pos1=instr(scopes,"Command completed successfully.")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'if the string is present, the command has executed succesfully<BR>&nbsp;<BR>&nbsp;if(pos1&lt;&gt;0) then<BR>&nbsp;&nbsp;checkserver=1<BR>&nbsp;else<BR>&nbsp;&nbsp;checkserver=0<BR>&nbsp;end if<BR>&nbsp;&nbsp;<BR>end function</P>
<P><BR>&nbsp;&nbsp;</P>
<P><BR>'this function takes as argument the output string that we get after the command show scope is executed and returns <BR>'the array of all scopes present in the server</P>
<P>function makescopearray(scopes)</P>
<P>&nbsp;&nbsp;&nbsp;set fso = createobject("Scripting.FileSystemObject")<BR>&nbsp;&nbsp;&nbsp;Set scopefile = fso.CreateTextFile("scopefile.txt")<BR>&nbsp;&nbsp;&nbsp;scopefile.writeline(scopes)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;'writing output string to a file<BR>&nbsp;&nbsp;&nbsp;scopefile.close<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;Set scopefile = fso.OpenTextFile("scopefile.txt")<BR>&nbsp;&nbsp;&nbsp;do While not scopefile.AtEndOfStream&nbsp;&nbsp;&nbsp;'reading line by line and checking for the string "Total No. of Scopes"<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp; &nbsp;&nbsp;line = scopefile.ReadLine<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if(instr(line,"Total No. of Scopes")=2) then&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;str = split(line)<BR>&nbsp;&nbsp;&nbsp;t=str(ubound(str)-1)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;'taking no. of scopes into t<BR>&nbsp;&nbsp;&nbsp;exit do<BR>&nbsp;&nbsp;&nbsp;end if</P>
<P>&nbsp;&nbsp;&nbsp;loop&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;scopefile.close<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;t=cint(t)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'converting string to integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if t=0 then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'if no scopes are present <BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;makescopearray=""&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;Set scopefile = fso.OpenTextFile("scopefile.txt")&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;for i=1 to 5<BR>&nbsp;&nbsp;&nbsp;scopefile.skipline&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'skipping first five lines <BR>&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;for i=0 to t-1<BR>&nbsp;&nbsp;&nbsp;str3=trim(scopefile.readline)<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;str3 = split(str3," ")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;redim preserve serverscope(i)<BR>&nbsp;&nbsp;&nbsp;serverscope(i)=str3(0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'adding scopes to array serverscope<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;next <BR>&nbsp;&nbsp;&nbsp;makescopearray = serverscope&nbsp;&nbsp;&nbsp;&nbsp;'returning the array to calling function<BR>&nbsp;&nbsp;&nbsp;scopefile.close<BR>&nbsp;&nbsp;&nbsp;end if<BR>end function</P>
<P>&nbsp;</P>
<P>'function to take reservations from source server and add to destination server for a given scope</P>
<P>sub reservedip(sourceadd,destadd,scopestr,filename,command)</P>
<P>&nbsp;dim outp<BR>&nbsp;set wshell = CreateObject("WScript.Shell") <BR>&nbsp;set obj = wshell.exec("netsh dhcp server "&amp;sourceadd&amp;" scope " &amp;scopestr&amp; " show reservedip" )<BR>&nbsp;outpsource = obj.stdout.readall()</P>
<P>&nbsp;call makeipandmacarray(outpsource)<BR>&nbsp;iparraysource = iparray<BR>&nbsp;macarraysource = macarray<BR>&nbsp;<BR>&nbsp;if(not isarray(iparraysource)) then<BR>&nbsp;wscript.echo "no reservations in the scope "&amp;scopestr&amp;" on the server "&amp;sourceadd <BR>&nbsp;&nbsp;exit sub<BR>&nbsp;end if<BR>&nbsp;</P>
<P>&nbsp;if(m=1 or m=2) then</P>
<P>&nbsp;set fso = createobject("Scripting.FileSystemObject")<BR>&nbsp;Set outfile = fso.openTextFile(filename,8)</P>
<P>&nbsp;for i=0 to ubound(iparraysource)&nbsp;&nbsp;<BR>&nbsp;outfile.writeline("netsh dhcp server "&amp;destadd&amp; " scope " &amp;scopestr&amp; " add reservedip " &amp;iparraysource(i)&amp; " " &amp; macarraysource(i))<BR>&nbsp;next<BR>&nbsp;outfile.close<BR>&nbsp;exit sub<BR>&nbsp;end if</P>
<P><BR>call addreservation(destadd,scopestr,iparraysource,macarraysource)</P>
<P>'now finaliparray and finalmacarray contain only the unique ip and mac addresses</P>
<P>if (not isarray(finaliparray) or finaliparray(0)="") then<BR>if ((m=1 or m=2)) then<BR>&nbsp;&nbsp;if (strcomp(command,"-migrate")=0 or (strcomp(command,"-sync")=0 and synccount=1)) then<BR>&nbsp;&nbsp;wscript.echo"output is in file "&amp;filename<BR>&nbsp;&nbsp;end if&nbsp;<BR>&nbsp;end if</P>
<P>&nbsp;exit sub<BR>&nbsp;end if</P>
<P>t=ubound(finaliparray)<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;set wshell = CreateObject("WScript.Shell") <BR>&nbsp;&nbsp;for i=0 to t<BR>&nbsp;&nbsp;set obj = wshell.exec("netsh dhcp server "&amp;destadd&amp;" scope " &amp;scopestr&amp; " add reservedip " &amp;finaliparray(i)&amp; " " &amp; finalmacarray(i))<BR>&nbsp;&nbsp;outp = &nbsp;obj.stdout.readall()<BR>&nbsp;&nbsp;if(instr(outp,"Command completed successfully.")) then<BR>&nbsp;&nbsp;wscript.echo "added reservation "&amp;finaliparray(i)&amp; " "&amp;finalmacarray(i)&amp;" to server "&amp;destadd&amp;" in scope "&amp;trim(scopestr)<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;wscript.echo "The specified IP address "&amp;finaliparray(i)&amp; " or hardware address "&amp; finalmacarray(i)&amp; " is being used by another client."<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;next<BR>&nbsp;<BR>&nbsp;if ((m=1 or m=2)) then<BR>&nbsp;&nbsp;if (strcomp(command,"-migrate")=0 or (strcomp(command,"-sync")=0 and synccount=1)) then<BR>&nbsp;&nbsp;wscript.echo"output is in file "&amp;filename<BR>&nbsp;&nbsp;end if&nbsp;<BR>&nbsp;end if<BR>end sub</P>
<P>sub makeipandmacarray(outp)</P>
<P><BR>&nbsp;redim iparray(0)<BR>&nbsp;redim macarray(0)</P>
<P>&nbsp;set fso = createobject("Scripting.FileSystemObject")<BR>&nbsp;Set scopefile = fso.CreateTextFile("scopefile.txt")<BR>&nbsp;scopefile.writeline(outp)<BR>&nbsp;scopefile.close<BR>&nbsp;&nbsp;<BR>&nbsp;Set scopefile = fso.openTextFile("scopefile.txt")<BR>&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;do While not scopefile.AtEndOfStream<BR>&nbsp;line = scopefile.ReadLine<BR>&nbsp;if(instr(line,"No of ReservedIPs")=1) then<BR>&nbsp;str = split(line)<BR>&nbsp;t=str(4)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'taking no. of reservations into t<BR>&nbsp;exit do<BR>&nbsp;end if<BR>&nbsp;loop&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;scopefile.close<BR>&nbsp;<BR>&nbsp;if t=0 then<BR>&nbsp;iparray = ""<BR>&nbsp;macarray = ""<BR>&nbsp;exit sub<BR>&nbsp;<BR>&nbsp;else<BR>&nbsp;Set scopefile = fso.openTextFile("scopefile.txt")<BR>&nbsp;<BR>&nbsp;for i=1 to 7<BR>&nbsp;scopefile.skipline<BR>&nbsp;next<BR>&nbsp;<BR>&nbsp;for i=1 to t<BR>&nbsp;redim preserve iparray(i-1)<BR>&nbsp;redim preserve macarray(i-1)<BR>&nbsp;string1=split(trim(scopefile.readline))<BR>&nbsp;<BR>&nbsp;iparray(i-1)=string1(0)<BR>&nbsp;macarray(i-1)=replace(string1(ubound(string1)),"-","")<BR>&nbsp;next<BR>&nbsp;end if<BR>&nbsp;scopefile.close<BR>&nbsp;<BR>end sub</P>
<P>sub migrate(str1)</P>
<P>&nbsp;&nbsp;if ubound(str1)&lt;4 then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' ensures that the command entered has required no. of arguments&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wscript.echo "Error: unrecongnized or incomplete command line."<BR>&nbsp;&nbsp;call helpfile()<BR>&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;dim k&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>&nbsp;&nbsp;k = checkserver(str1(2))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'checking if the source server exists or not...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'or if they are entered correct or not<BR>&nbsp;&nbsp;if k=0 then<BR>&nbsp;&nbsp;wscript.echo "server "&amp;str1(2)&amp; " not present or is entered wrongly"<BR>&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;scopes1 = scopes<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;k = checkserver(str1(3)) &nbsp;&nbsp;<BR>&nbsp;&nbsp;if k=0 then<BR>&nbsp;&nbsp;wscript.echo "server "&amp;str1(3)&amp; " not present or is entered wrongly"<BR>&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;end if</P>
<P>&nbsp;&nbsp;scopes2 = scopes&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR>'comes here if both servers are entered correctly<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;sourcescope = makescopearray(scopes1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'sourcescope here has all scopes from source server<BR>&nbsp;&nbsp;&nbsp;if(isarray(sourcescope)) then&nbsp;&nbsp;&nbsp;&nbsp; 'checking if there are any scopes in source server &nbsp;<BR>&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;wscript.echo "no scopes present on server "&amp;str1(2)&nbsp;<BR>&nbsp;&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;&nbsp;end if&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;bound=ubound(str1)<BR>&nbsp;&nbsp;&nbsp;if(strcomp(str1(4),"all")=0) then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'checking if the option "all" is entered <BR>&nbsp;&nbsp;&nbsp;&nbsp;if(bound&gt;4 and bound&lt;7) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(strcomp(str1(5),"-preview")&lt;&gt;0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wscript.echo "Error: unrecongnized or incomplete command line."<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call helpfile()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(bound=6) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename = str1(6)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m=2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m=1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename = "output.txt"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m=0<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;scope=sourcescope&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'scope array now contains all the scopes from source server&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;if(strcomp(str1(bound),"-preview")=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m=1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename = "output.txt"<BR>&nbsp;&nbsp;&nbsp;&nbsp;else if(strcomp(str1(bound-1),"-preview")=0) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m=2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename = str1(bound)<BR>&nbsp;&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m=0<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P><BR>&nbsp;&nbsp;&nbsp;p=0<BR>&nbsp;&nbsp;&nbsp;for i = 4 to ubound(str1)-m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'this is the case when scopes are entered as arguments<BR>&nbsp;&nbsp;&nbsp;if(isscope(str1(i),sourcescope)) then&nbsp;&nbsp;&nbsp;&nbsp; 'checking if the given scope is present in source server&nbsp;<BR>&nbsp;&nbsp;&nbsp;redim preserve scope(p)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'if present then add the scope entered to the array 'scope'&nbsp;<BR>&nbsp;&nbsp;&nbsp;scope(p)=str1(i)<BR>&nbsp;&nbsp;&nbsp;p=p+1&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;else <BR>&nbsp;&nbsp;&nbsp;&nbsp;if(synccount=0) then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'if the scope entered is not present in the source server&nbsp;<BR>&nbsp;&nbsp;&nbsp;wscript.echo "scope "&amp;str1(i)&amp; " is not present in the server "&amp;str1(2)&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;next</P>
<P><BR>&nbsp;&nbsp;&nbsp;end if&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;erase sourcescope&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'freeing the space allocated to sourcescope&nbsp;<BR>&nbsp;&nbsp;&nbsp;if(not isarray(scope)) then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'checking if the scope array has some scopes or not&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;destscope = makescopearray(scopes2)&nbsp;&nbsp;&nbsp;&nbsp; 'destscope has all scopes from destination server&nbsp;<BR>&nbsp;&nbsp;&nbsp;if(isarray(destscope)) then&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'checking if there are scopes present on destination server&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;wscript.echo "no scopes present on server "&amp;str1(3)&nbsp;<BR>&nbsp;&nbsp;&nbsp;argerror=1<BR>&nbsp;&nbsp;&nbsp;exit sub<BR>&nbsp;&nbsp;&nbsp;end if&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;if(m=1 or m=2) then<BR>&nbsp;&nbsp;&nbsp;if(synccount=0) then<BR>&nbsp;&nbsp;&nbsp;set fso = createobject("Scripting.FileSystemObject")<BR>&nbsp;&nbsp;&nbsp;set outfile = fso.createtextfile(filename)<BR>&nbsp;&nbsp;&nbsp;outfile.close<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;end if</P>
<P>&nbsp;&nbsp;&nbsp;for i=0 to ubound(scope)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if(isscope(scope(i),destscope)) then&nbsp;&nbsp;&nbsp;&nbsp; 'checking if scopes are present on destination server or not &nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;call reservedip(str1(2),str1(3),scope(i),filename,str1(1)) 'this will take reservations in the given scope from source server and output add reservedip(destination) command to a file<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;wscript.echo "scope "&amp;scope(i)&amp; " not present in server "&amp;str1(3)&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;&nbsp;end if&nbsp;&nbsp;&nbsp;</P>
<P><BR>&nbsp;&nbsp;&nbsp;next<BR>&nbsp;&nbsp;if (m=1 or m=2) then<BR>&nbsp;&nbsp;&nbsp;if(strcomp(str1(1),"-migrate")=0 or (strcomp(str1(1),"-sync")=0 and synccount=1)) then<BR>&nbsp;&nbsp;&nbsp;wscript.echo"output is in file "&amp;filename<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;end if<BR>end sub</P>
<P>X-----------------------End Paste---------------------X</P>
<P>And here is a more formal looking help: <BR>USAGE:<BR>&nbsp; Rmanager&nbsp; /? <BR>&nbsp;&nbsp;&nbsp;&nbsp; -migrate &lt;source server&gt; &lt;destination server&gt; &lt;all|&lt;list of scopes&gt;&gt; <BR>&nbsp;&nbsp;[-preview [filename]]<BR>&nbsp;&nbsp;&nbsp;&nbsp; -sync &lt;server1&gt; &lt;server2&gt; &lt;all | &lt;list of scopes&gt;&gt; <BR>&nbsp;&nbsp;[-preview [filename]]<BR>&nbsp;&nbsp;&nbsp;&nbsp; -dumplease &lt;filename&gt; &lt;server&gt; &lt;all | &lt;listof scopes&gt;&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; -makereservation &lt;server&gt; &lt;filename&gt;</P>
<P>&nbsp;&nbsp;&nbsp; Options:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /?&nbsp;&nbsp;&nbsp;&nbsp; display this help message<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -migrate &nbsp;&nbsp;&nbsp; copies reservations from all or the specified <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scopes from source to destination server...if <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; preview is specified, it shows the commands that <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; will be executed, in the output file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -sync&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronises reservations between two servers for <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all or the specified scopes....if preview is <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specified, it shows the commands that will be <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; executed, in the output file<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -dumplease&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outputs the ip and macaddresses of all clients in <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the given server for the given scopes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -makereservation&nbsp;&nbsp;&nbsp; adds reservations for the ip and mac address pairs <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from the given file into the given server<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>Examples:<BR>&nbsp;&nbsp;&nbsp; &gt; cscript rmanager.vbs Rmanager -migrate 120.0.0.1 120.0.0.2 all&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;....copies reservations in all scopes from server 120.0.0.1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to server 120.0.0.2<BR>&nbsp;&nbsp;&nbsp; &gt; cscript rmanager.vbs&nbsp;Rmanager -sync 120.0.0.1 120.0.0.2 120.0.0.0 <BR>&nbsp;&nbsp;....synchronises reservations between the two servers <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 120.0.0.1 and 120.0.0.2 for the scope 120.0.0.0<BR>&nbsp;&nbsp;&nbsp; &gt; cscript rmanager.vbs Rmanager -dumplease out.txt 120.0.0.1 all<BR>&nbsp;&nbsp;...dumps all clients' ip and mac addresses into out.txt<BR>&nbsp;&nbsp;&nbsp; &gt; cscript rmanager.vbs Rmanager -makereservation 120.0.0.1 out.txt<BR>&nbsp;&nbsp;...takes ip and mac address pairs from the file out.txt and <BR>&nbsp;&nbsp;&nbsp;&nbsp; makes reservation on the server 120.0.0.1&nbsp;</P>
<P>If you feel this tool is great, then don't thank me. Rather thank <STRONG>Amit Mirchandani</STRONG> who is an intern working with us.. :-)</P>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/00/71/46/85/RManager.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-00-71-46-85/RManager.zip">RManager.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>How to find out how many more addresses are available in the DHCP server?</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/how-to-find-out-how-many-more-addresses-are-available-in-the-dhcp-server</link>
      <pubDate>Fri, 17 Mar 2006 03:30:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2006/03/17/how-to-find-out-how-many-more-addresses-are-available-in-the-dhcp-server/</guid>
      <description><![CDATA[I got a couple of questions from a
collegue regarding configuring DHCP server from a client...]]></description>
      <content:encoded><![CDATA[

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Arial;">I got a couple of questions from a
collegue regarding configuring DHCP server from a client machine. Before you
can configure the DHCP server from a client machine like XP through netsh or
MMC, you need to install something. Please refer: <a href="../../anto_rocks/archive/2005/04/05/405511.aspx%20"><span style="color: windowtext;">http://blogs.msdn.com/anto_rocks/archive/2005/04/05/405511.aspx
</span></a><br>
Now coming to the questions:<u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">1)<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>from a client side, I would like to check if the server has additional
leases. <u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">a.<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>assume that the client doesn’t have admin privilege to the DHCP server<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;">[AntoAMJ]:
If the client does not have the admin/user priveledge to configure the DHCP
server, then the only way to determine whether the server has additional leases
is to send a DHCP DISCOVER packet and waiting for a DHCP OFFER to come. If the
DHCP OFFER has a valid address, then the server has additional leases. To make
sure that the DHCP server does not commit the lease to this client, abstain
from sending the DHCP REQUEST in response to the OFFER. This way the address
which is given to the client will be reclaimed automatically. Care must be
taken so that an artificial MAC address is put into the DISCOVER so that the
DHCP server does not identify this request to the actual client but treats it
as a new client. This is needed if the client has already an valid lease from
the same DHCP server. This is a proper hack. Don’t do this unless you are
desperate. Moreover you won’t be able to find the no of free addresses this way.<u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;"><u2:p></u2:p>b.<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>assume that the client has admin privilege to the dhcp server<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;">[AntoAMJ]:
If the client has admin/user priveldge to configure the DHCP server, then the
best way to find out the number of additional leases (free addresses) in a
given scope in a given DHCP server is throught the netsh command netsh dhcp
server show mibinfo. This command will print the number of available leases for
every scope in the DHCP server. <u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;"><u2:p></u2:p>2)<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;
</span>from a client side, I would like to release a lease (or delete the
client’s lease)<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">a.<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>assume that the client doesn’t have admin privilege to the DHCP server<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormalIndent" style="text-indent: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">[AntoAMJ]: The client does not need admin priviledge to the
DHCP server to release its own lease. All it needs to do is call the ipconfig
/release.<u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;"><u2:p><u2:p></u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">b.<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>assume that the client has admin privilege to the dhcp server<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormalIndent" style="text-indent: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">&nbsp;[AntoAMJ]: The client does not need admin priviledge
to the DHCP server to release its own lease. All it needs to do is call the
ipconfig /release.<u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Arial;"><u2:p><u2:p></u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Arial;"><u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Arial;"><u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">3)<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;
</span>from a client side, delete a lease on the dhcp server that the client
doesn’t own<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">a.<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>assume that the client doesn’t have admin privilege to the DHCP server<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormalIndent" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;">[AntoAMJ]: Send the DHCP RELEASE packet on behalf of the
client. Create your own release packet with the MAC address of the client whose
lease has to be deleted. This is also a hack. Don’t do this unless you are
desperate.<u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;"><u2:p><u2:p></u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">b.<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;
</span>assume that the client has admin privilege to the dhcp server<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormalIndent" style="text-indent: 0.5in;"><span style="font-size: 10pt; font-family: Arial;">[AntoAMJ]: The best bet for you is call the netsh command
netsh dhcp server delete lease.<u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;"><u2:p><u2:p></u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Arial;"><u2:p>&nbsp;</u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><span style="font-size: 10pt; font-family: Arial;">4)<span style="font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;
</span>from a client side, discover if there is a dhcp server on the subnet<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;">[AntoAMJ]:
Send a DISCOVER and wait for OFFERS to come. If there are any DHCP server which
are servincing the subnet, then that many OFFER’s will come to the client. In
fact if I remember correctly, there was a tool called dhcploc.exe which does
this automatically for you. <u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;">DhcpLoc.exe
Documentation: <a href="http://technet2.microsoft.com/WindowsServer/en/Library/8fa42e83-ec08-4a9b-9057-8909f7ed433e1033.mspx"><span style="color: windowtext;">http://technet2.microsoft.com/WindowsServer/en/Library/8fa42e83-ec08-4a9b-9057-8909f7ed433e1033.mspx</span></a>
<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style="margin-left: 1in;"><span style="font-size: 10pt; font-family: Arial;">DhcpLoc.exe
Download: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&amp;displaylang=en"><span style="color: windowtext;">http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&amp;displaylang=en</span></a>
<u2:p></u2:p><u1:p></u1:p></span><o:p></o:p></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Arial;"><u1:p><br style="">
<!--[if !supportLineBreakNewLine]--><br style="">
<!--[endif]--></u1:p></span><o:p></o:p></p>



<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial;"><u1:p></u1:p><o:p>&nbsp;</o:p></span></p>

]]></content:encoded>
    </item>
    <item>
      <title>How to programatically set/view the DNS settings.</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/how-to-programatically-setview-the-dns-settings</link>
      <pubDate>Mon, 06 Mar 2006 02:23:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2006/03/06/how-to-programatically-setview-the-dns-settings/</guid>
      <description><![CDATA[How to programmactically set/view the DNS settings that we set in the DNS tab of the...]]></description>
      <content:encoded><![CDATA[<font face="Arial" size="2">How to programmactically set/view the DNS settings that we set in the DNS tab of the Server/Scope/Reservation property page?<br><br>Before we investigate how to retrieve this information, let me first explain to you that this information is persisted as a DHCP standard option. The option number that is using is option number 81. Having said that since the DHCP server is using an option number to persist this information, it does not send this information to the client, when the client requests for it. Rather this 81 option is treated as a special option which is used only for persisting the configuration information. The following is how this information is encoded into the option 81.<br><br>Option 81 is a DWORD:<br><br>1st bit set to '1' if the Check box "Enable DNS Dynamic updates according to settings below" is selected (If this bit is off (as in the case of the screenshot), all other possibilities are ruled out which case the value of the option will always be 0).<br><br>2nd bit set to '1' if "Dynamically update DNS A and PTR records for DHCP clients that do not request updates (for example, clients running Windows NT 4.0).<br><br>3rd bit set to '1' if Check box "Discard A and PTR records when lease is deleted' is selected<br><br>5th bit To choose between 'Dynamically update DNS A and PTR records only if requested by DHCP clients/" (value of 5th bit = '0') And "Always dynamically update DNS A and PTR records" (value of 5th bit = '1')<br><br>To double check the encoding, play arround with the various check boxes in the DNS-Scope UI and see the reflected change in the scope option by typing show optionvalue at the scope level.<br><br>There are two ways to get the required information programmatically:<br><br>1)&nbsp;&nbsp;&nbsp;&nbsp; Using the API DhcpGetOptionValue. This is a public function which can be called. (The option id is 81)<br><br>2)&nbsp;&nbsp;&nbsp;&nbsp; We can also use the netsh command to get this information: Eg netsh dhcp server show optionvalue 81<br><br><br></font>]]></content:encoded>
    </item>
    <item>
      <title>How to override the system default for the threshold for the event 1020.</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/how-to-override-the-system-default-for-the-threshold-for-the-event-1020</link>
      <pubDate>Wed, 02 Nov 2005 01:01:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2005/11/02/how-to-override-the-system-default-for-the-threshold-for-the-event-1020/</guid>
      <description><![CDATA[Question: How can I change the threshold value for firing of event 1020. Event 1020 fired by the...]]></description>
      <content:encoded><![CDATA[<SPAN class=919560008-24102005><FONT face=Arial color=#0000ff size=2>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Question: How can I change the threshold value for firing of event 1020. Event 1020 fired by the DHCP server is fired whenever the amount of free addresses in a scope is less than 80%.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>E.g:</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT color=#000000><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY: Arial">Event Type: &nbsp; &nbsp; Warning <BR>Event Source: &nbsp; DhcpServer <BR>Event Category: None <BR>Event ID: &nbsp; &nbsp; &nbsp;</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 1020 </SPAN></FONT><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY: Arial"><BR><FONT color=#000000>Date: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3/08/2005 <BR>Time: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 19:50:48 <BR>User: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; N/A <BR>Computer: &nbsp; &nbsp; &nbsp; NETSERVER <BR>Description: <BR>Scope, 10.156.32.0, is</FONT><SPAN style="COLOR: red"> </SPAN></SPAN><FONT size=3><B><SPAN style="COLOR: red; FONT-FAMILY: Arial">81</SPAN></B><B><SPAN style="FONT-FAMILY: Arial"><FONT color=#000000> </FONT></SPAN></B></FONT><SPAN style="FONT-SIZE: 8.5pt; FONT-FAMILY: Arial"><FONT color=#000000>percent full with only 35 IP addresses remaining.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>For some people they might want to change this threshold value of 80%. For them firing this warning at 90% might make more sense of it the threshold could be lower that 80%. For these purposes, to override the system default of 80%, what can I do?</FONT></P>
<P></FONT></SPAN><SPAN class=919560008-24102005><FONT face=Arial color=#0000ff size=2>Answer:</FONT></SPAN><SPAN class=919560008-24102005><FONT face=Arial color=#0000ff size=2>I believe there is indeed a registry key which can override the default threshold for logging event 1020. <STRONG>The reg key is named "DhcpAlertPercentage" and is of type REG_DWORD.</STRONG> You can create it under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dhcpserver\Parameters. </FONT></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>About "Default Routing and Remote Access Class"</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/about-default-routing-and-remote-access-class</link>
      <pubDate>Wed, 02 Nov 2005 00:55:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2005/11/02/about-default-routing-and-remote-access-class/</guid>
      <description><![CDATA[The following is a question i received from one of the internal groups and my answer to the same. I...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The following is a question i received from one of the internal groups and my answer to the same. I hope you find the information usefull.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Question:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am trying to configure options to be applied specifically to workstations that make a vpn connection. The workstations appear to get&nbsp;all options that are set on the dhcp server as long as they are "Default User Class" options but as soon as I set an option to "Default Routing and Remote Access Class" the workstations no longer get the options.</SPAN>&nbsp;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have run the command on the client "ipconfig /setclassid test "Default Routing and Remote Access Class" where test is the name of the vpn connectoid.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The client gets an ip address and the ipconfig output even shows "DHCP Class ID: Default Routing and Remote Access Class" but it still fails to get the options. </SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I even moved the client to the local lan and set the class on the NIC to rule out RRAS but still don't get the options applied. </SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In my tests, Windows 2003 DHCP is not assigning options based on the clients class-id of "Default Routing and Remote Access Class".</SPAN>&nbsp;<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Can a client have multiple classes? </SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Does it send all classes in a DHCP&nbsp;inform?</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If so, how does DHCP determine which class to select from?</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If I change the class-id on a client to be "Default Routing and Remote Access Class" so that I can set specific options on the machine when it is in the field, must I remove or change that class on the workstation when it returns to the LAN?<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Answer:<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">&nbsp;&nbsp;&nbsp; <SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Let me clarify first of all that the class "Default Routing and Remote Access Class" is a predefined user class meant to used as a way to identify clients which are getting network access using VPN. These clients first talk to the VPN server to get connectivity. The VPN server tries to get the ip address for the remote client by talking to the DHCP server. The DHCP server assigns the VPN server set of addresses from which the VPN server assigns to the remote clients. Now that the remote client gets an IP address, it tries to get all other configuration information directly from the DHCP server through DHCP INFORM packets. When the DHCP server recieves the INFORMS from such remote clients, it identifies that these clients are belonging to the "Default Routing and Remote Access Class" through an internal mechanism and it picks up the configuration present under the class "Default Routing and Remote Access Class". This is how <STRONG><SPAN style="FONT-FAMILY: Arial">this user class </SPAN></STRONG>is meant to be used.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Regarding your other specific questions:</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Can a client have multiple classes?&nbsp; </SPAN></STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">No. It can have atmost one user class and one vendor class. If it does not have a expliclty defined user/vendor class, it is assumed to belong to the Default User/Vendor class.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Does it send all classes in a DHCP&nbsp;inform?</SPAN></STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">: NA. See answer to previous question.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">If so, how does DHCP determine which class to select from?</SPAN></STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">: NA. See answer to previous question.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">If I change the class-id on a client to be "Default Routing and Remote Access Class" so that I can set specific options on the machine when it is in the field, must I remove or change that class on the workstation when it returns to the LAN?: </SPAN></STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">First of all when you mention "Default Routing and Remote Access Class" as mentioned in the UI of the DHCP server, you are referring to the display name of the user class. This is not what you would see if you parse the user class information of the DHCP packet. The actual byte sequence which represents&nbsp;this user class, can be quite different. Whereas, when you mention the user class in the ipconfig /setclassid command, what you are mentioning is the actual byte string that will be put into the user class field in the DHCP packet by the DHCP client when sending the requests. You should not attempt to use upconfig /setclassid to set the user class of the clients and use the name of the predefined User classes. When you want to assign specific set of clients specific config, you might want to create a new user class and configure that in the dHCP server and on the client using ipconfig /setclassid.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt">&nbsp;<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">I hope i have cleared your doubts... Let me know if you have any further issues.</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Interaction between DHCP and RRAS (VPN):</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"><A title=http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/8e9004b2-1153-4202-89e2-b7f0a9c7f8a4.mspx href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/8e9004b2-1153-4202-89e2-b7f0a9c7f8a4.mspx">http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/8e9004b2-1153-4202-89e2-b7f0a9c7f8a4.mspx</A></SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><A title=http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/TechRef/8006f246-2029-4bad-b9f0-4f31a56b0590.mspx href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/TechRef/8006f246-2029-4bad-b9f0-4f31a56b0590.mspx"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/TechRef/8006f246-2029-4bad-b9f0-4f31a56b0590.mspx</SPAN></A><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;Please refer the section on <STRONG><SPAN style="FONT-FAMILY: Arial">"DHCP and Routing and Remote Access"</SPAN></STRONG></SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><A title=http://support.microsoft.com/kb/160699/ href="http://support.microsoft.com/kb/160699/">http://support.microsoft.com/kb/160699/</A></SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">General discussion about user/vendor classes:</SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><A title=http://blogs.msdn.com/anto_rocks/archive/2005/02/25/380231.aspx href="/anto_rocks/archive/2005/02/25/380231.aspx">http://blogs.msdn.com/anto_rocks/archive/2005/02/25/380231.aspx</A></SPAN><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>Follow-up article on DHCP server callout DLL.</title>
      <link>https://docs.microsoft.com/archive/blogs/anto_rocks/follow-up-article-on-dhcp-server-callout-dll</link>
      <pubDate>Tue, 24 May 2005 03:33:00 GMT</pubDate>
      <dc:creator><![CDATA[anto_rocks]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/anto_rocks/2005/05/24/follow-up-article-on-dhcp-server-callout-dll/</guid>
      <description><![CDATA[Hi all,
I got a VS.NET solution for the sample DHCP server callout DLL. I have shared it to the...]]></description>
      <content:encoded><![CDATA[<P>Hi all,</P>
<P>I got a VS.NET solution for the sample DHCP server callout DLL. I have shared it to the world here: <A href="http://www.geocities.com/anto_rocks/DHCPCalloutDL.zip">http://www.geocities.com/anto_rocks/DHCPCalloutDL.zip</A>. Please let me know of any copyright issues as i do not know who wrote this code. I suppose this will work as i did not test it out myself. I just got it from my colleague.</P>
<P>Thanks, A.J.Anto</P>]]></content:encoded>
    </item>
  </channel>
</rss>