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

<channel>
	<title>Indented! &#187; subnet</title>
	<atom:link href="http://www.indented.co.uk/index.php/tag/subnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.indented.co.uk</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 10:45:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>VbScript: GetADSubnets</title>
		<link>http://www.indented.co.uk/index.php/2008/10/25/vbscript-active-directory-subnets/</link>
		<comments>http://www.indented.co.uk/index.php/2008/10/25/vbscript-active-directory-subnets/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 10:46:37 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[VbScript]]></category>
		<category><![CDATA[subnet]]></category>
		<category><![CDATA[vbs]]></category>

		<guid isPermaLink="false">http://www.highorbit.co.uk/?p=543</guid>
		<description><![CDATA[The VbScript below demonstrates how subnet information might be retrieved from Active Directory. It is possible to use a search using to return this information (for objectClass=subnet). This method connects to the subnets container and loops through the contents returning the network address and mask length in a Dictionary object. Function GetADSubnets ' Return Type: [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The VbScript below demonstrates how subnet information might be retrieved from Active Directory. It is possible to use a search using to return this information (for objectClass=subnet). This method connects to the subnets container and loops through the contents returning the network address and mask length in a Dictionary object.<br />
<span id="more-543"></span></p>
<pre class="brush: vb;">
Function GetADSubnets
  ' Return Type: Array

  Dim objRootDSE : Set objRootDSE = GetObject(&quot;LDAP://RootDSE&quot;)
  Dim objSubnets : Set objSubnets = GetObject(&quot;LDAP://CN=Subnets,CN=Sites,&quot; &amp; _
    objRootDSE.GEt(&quot;configurationNamingContext&quot;))

  Dim arrSubnets() : Dim i : i = 0
  For Each objSubnet in objSubnets
    ReDim Preserve arrSubnets(i)
    arrSubnets(i) = objSubnet.Get(&quot;name&quot;)
    i = i + 1
  Next

  GetADSubnets = arrSubnets
End Function
</pre>
<h3>Usage example</h3>
<pre class="brush: vb;">
WScript.Echo Join(GetADSubnets, vbCrlf)
</pre>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.indented.co.uk/index.php/2008/10/25/vbscript-active-directory-subnets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
