<?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>Andrew Healey's Blog &#187; windows</title>
	<atom:link href="http://halfloaded.com/blog/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://halfloaded.com</link>
	<description>Smash forehead on keyboard to continue...</description>
	<lastBuildDate>Tue, 20 Jul 2010 18:11:39 +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: Quickly determine architecture</title>
		<link>http://halfloaded.com/blog/vbscript-quickly-determine-architecture/</link>
		<comments>http://halfloaded.com/blog/vbscript-quickly-determine-architecture/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 18:10:11 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[vbScript]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[x64]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=442</guid>
		<description><![CDATA[I&#8217;ve been using a routine to determine 64-bit v 32-bit workstations for some time checking the registry for the PROCESSOR_ARCHITECTURE in the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment path. However, this was proving to be error prone. So, I just gave up that method altogether since all Windows x64 editions have a &#8220;%SystemDrive%\Program Files (x86)&#8221; directory. This makes it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://halfloaded.com/wp-content/uploads/2010/07/32-64.jpg"><img src="http://halfloaded.com/wp-content/uploads/2010/07/32-64-150x150.jpg" alt="" title="XP x64" width="150" height="150" class="alignright size-thumbnail wp-image-445" /></a>I&#8217;ve been using a routine to determine 64-bit v 32-bit workstations for some time checking the registry for the PROCESSOR_ARCHITECTURE in the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment path.  However, this was proving to be error prone.  So, I just gave up that method altogether since all Windows x64 editions have a &#8220;%SystemDrive%\Program Files (x86)&#8221; directory.  This makes it just a quick and easy call the folderexists method of the filesystemobject.</p>
<p>The only downside is that can&#8217;t be used remotely but since most of my scripts are used in local policies, this shouldn&#8217;t be an issue.</p>
<p>Cheers!</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> is64bit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">Dim</span> filesys : <span style="color: #FF8000;">Set</span> filesys <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">Dim</span> bln64bit : bln64bit <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
	<span style="color: #0600FF;">If</span> filesys.<span style="color: #0000FF;">FolderExists</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;C:\Program Files (x86)&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">then</span> bln64bit <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
	is64bit <span style="color: #008000;">=</span> bln64bit
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;t=vbScript%3A+Quickly+determine+architecture" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;title=vbScript%3A+Quickly+determine+architecture&amp;summary=I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=vbScript%3A+Quickly+determine+architecture+-+File: /data/app/webapp/functions.php<br />Line: 43<br />Message: Table 'b2l_shrinker.phurl_urls' doesn't exist&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=vbScript%3A+Quickly+determine+architecture&amp;du=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;cn=I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;title=vbScript%3A+Quickly+determine+architecture" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;submitHeadline=vbScript%3A+Quickly+determine+architecture&amp;submitSummary=I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/vbscript-quickly-determine-architecture/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22vbScript%3A%20Quickly%20determine%20architecture%22&amp;body=Link: http://halfloaded.com/blog/vbscript-quickly-determine-architecture/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/vbscript-quickly-determine-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part 1: Blocking Bad Hosts &#8211; Finding Them, Easily</title>
		<link>http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/</link>
		<comments>http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 07:19:13 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[event log]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vbScript]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=335</guid>
		<description><![CDATA[Download Script: get-bad-hosts.zip While troubleshooting some issues on an OWA Front-End server, I went over to the security log to see if the authentication attempts were getting past this box. The problem I found was the log was so full of failed logon attempts it was difficult to filter out what I was looking for. [...]]]></description>
			<content:encoded><![CDATA[<p>Download Script: <a href="http://halfloaded.com/wp-content/uploads/2009/12/get-bad-hosts.zip">get-bad-hosts.zip</a></p>
<p>While troubleshooting some issues on an OWA Front-End server, I went over to the security log to see if the authentication attempts were getting past this box.  The problem I found was the log was so full of failed logon attempts it was difficult to filter out what I was looking for.  In a twelve hour period, there were thousands of 529 events in the security log.  Now, I know this is nothing new, but I found a few patterns.  I manually exported the log to a CSV, parsed out all the source ip addresses and opened it up in Excel.  What I found was that 98.7% of failed logon attempts were made by just four different ip addresses.  (I recommend using <a href="http://www.maxmind.com/app/locate_ip" target="_blank">MaxMind&#8217;s GeoIP Address Locator</a> for help in determining where the source addresses are located.)<span id="more-335"></span></p>
<p>The easy fix is to setup an IPSec policy to block all traffic coming from those addresses.  And I did just that.  There are many different methods to blocking bad hosts.  And, anybody who has dealt with this knows, they will come back.  Just from different addresses.</p>
<p>One other piece I was able to get from this is that there are several of our users whom have fat fingered their passwords within ActiveSync (or they just have it setup wrong).  And then there are those users who have forgotten their domain, e-mail address, username, etc.</p>
<p>This is step one in my project to automate the blocking of bad hosts.  My goal is to build an automated method for blocking hosts with a high percentage of bad logon attempts within <em>n</em> hours.  And, even if I can&#8217;t get it 100% automated, this first whack at it took my bad logon attempts from 800 per hour to 25 per hour; nearly a 97% improvement!  And, a lot less crap to sift through when troubleshooting real issues.</p>
<p>So, my first goal is to automate a method of extracting the data I want from the event log.  (The script can be found below.)  The most important piece of data is the source ip address.  However, the other pieces of data I decided to extract could be helpful in determining the legitimacy of the logon failure.</p>
<p>To get the data, simply download the script and run &#8220;cscript /nologo get-bad-hosts.vbs &gt; bad-hosts.csv&#8221; (w/o the quotes).  You can then open the file in Excel, do a quick pivot-table and identify the source addresses with the most hits.  At that point, you can add the host (or address block) to an ipsec policy to block all traffic from that address.</p>
<p>In my next post, I&#8217;ll explain the details in setting up a quick ipsec policy to block the bad guys.  Cheers!</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'==========================================================================</span>
<span style="color: #008080; font-style: italic;">' VBScript Source File</span>
<span style="color: #008080; font-style: italic;">' NAME: get-bad-hosts.vbs</span>
<span style="color: #008080; font-style: italic;">' AUTHOR: Andrew J Healey</span>
<span style="color: #008080; font-style: italic;">' WEB: http://halfloaded.com/</span>
<span style="color: #008080; font-style: italic;">' DATE  : Dec 21 2009</span>
<span style="color: #008080; font-style: italic;">' COMMENT: This script will return data in csv format for use in determining</span>
<span style="color: #008080; font-style: italic;">'	hack, lockout or bad logon attempts</span>
<span style="color: #008080; font-style: italic;">' PROCESS: 1) query event log for event id 529; 2) parse data to return</span>
<span style="color: #008080; font-style: italic;">'	useful data; 3) output to screen</span>
<span style="color: #008080; font-style: italic;">' USAGE: cscript /nologo get-bad-hosts.vbs c:\bad-hosts.csv</span>
<span style="color: #008080; font-style: italic;">'==========================================================================</span>
&nbsp;
<span style="color: #FF8000;">Option</span> Explicit
<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> strComputer, objWMIService, colLoggedEvents
<span style="color: #0600FF;">Dim</span> objEvent, objRegEx, colMatches, strMatch
<span style="color: #0600FF;">Dim</span> strUserName, strWorkstation, strIPAddress, strDomain
&nbsp;
<span style="color: #008080; font-style: italic;">'Change to name of computer to query remote machine</span>
strComputer <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;.&quot;</span>
<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> GetObject<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;winmgmts:&quot;</span> _
    <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;{impersonationLevel=impersonate}!\\&quot;</span> <span style="color: #008000;">&amp;</span>amp; strComputer <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;\root\cimv2&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Event 529 in the security log are &quot;Failure Audit&quot; for a &quot;Logon/Logoff&quot;</span>
<span style="color: #FF8000;">Set</span> colLoggedEvents <span style="color: #008000;">=</span> objWMIService.<span style="color: #0000FF;">ExecQuery</span> _
        <span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Select * from Win32_NTLogEvent Where Logfile = 'Security' and &quot;</span> _
            <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;EventCode = '529'&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Write header to screen</span>
wscript.<span style="color: #0000FF;">echo</span> <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;User Name&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Workstation&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Source IP&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Windows Domain&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Date/Time&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Loop through all events matching criteria above: 529 in sec log</span>
<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objEvent in colLoggedEvents
	<span style="color: #008080; font-style: italic;">'Use regex to parse any ip addresses from event</span>
	<span style="color: #008080; font-style: italic;">' if no address found, goto next record</span>
	<span style="color: #FF8000;">Set</span> objRegEx <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;VBScript.RegExp&quot;</span><span style="color: #000000;">&#41;</span>
	objRegEx.<span style="color: #0000FF;">Global</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
	objRegEx.<span style="color: #0000FF;">IgnoreCase</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the user name that was used</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;(\tUser Name:.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strUserName <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the workstation name that was used</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;(\tWorkstation Name:.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strWorkstation <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the source ip address</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;(\tSource Network Address:.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strIPAddress <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the domain that was used</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;\tDomain:(.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strDomain <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Output clean csv line for easy reading in spreadsheet program</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strUserName<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strWorkstation<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strIpAddress<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strDomain<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; WMIDateStringToDate<span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">TimeWritten</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Next</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> GetCleanText<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">byVal</span> strText<span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'This will cleanup the text and return only necessary data</span>
	<span style="color: #008080; font-style: italic;">' I'm sure there is a better way to do this :)</span>
	<span style="color: #0600FF;">dim</span> tmp,txt
	tmp <span style="color: #008000;">=</span> <span style="color: #0600FF;">Split</span><span style="color: #000000;">&#40;</span>strText,<span style="color: #808080;">&quot;:&quot;</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> tmp<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> <span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span>txt,vbTab,<span style="color: #808080;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> <span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span>txt,vbCrLf,<span style="color: #808080;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> <span style="color: #0600FF;">Trim</span><span style="color: #000000;">&#40;</span>txt<span style="color: #000000;">&#41;</span>
	GetCleanText <span style="color: #008000;">=</span> txt
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> WMIDateStringToDate<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">byVal</span> dtmEventDate<span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Borrowed from the &quot;Hey, Scripting Guy! BLOG&quot;</span>
	<span style="color: #008080; font-style: italic;">' --&amp;gt; Search: WMIDateStringToDate</span>
    WMIDateStringToDate <span style="color: #008000;">=</span> <span style="color: #0600FF;">CDate</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">5</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;/&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
        <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">7</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;/&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">4</span><span style="color: #000000;">&#41;</span> _
            <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot; &quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span> <span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">9</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;:&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
                <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">11</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;:&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, _
                    <span style="color: #FF0000;">13</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;t=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;title=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily&amp;summary=Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily+-+http://b2l.me/b4ge9&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily&amp;du=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;cn=Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;title=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;submitHeadline=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily&amp;submitSummary=Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Part%201%3A%20Blocking%20Bad%20Hosts%20-%20Finding%20Them%2C%20Easily%22&amp;body=Link: http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vbScript &#8211; List All Members Of Sensitive Groups: Schema, Enterprise and Domain Admins</title>
		<link>http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/</link>
		<comments>http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:24:46 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[vbScript]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=247</guid>
		<description><![CDATA[Update 2009.04.16: At the request of a commenter, I added a couple lines to the script that will dump the output to a text file in the root of the C: drive. I also corrected a couple errors in the script. I was tasked to get a dump of all the users in our Schema [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update <em>2009.04.16</em></strong>: At the request of a commenter, I added a couple lines to the script that will dump the output to a text file in the root of the C: drive.  I also corrected a couple errors in the script.</p>
<p>I was tasked to get a dump of all the users in our Schema Admins, Enterprise Admins and Domain Admins for our Forest.  I started thinking about it and realized a couple things.  Two of the three groups reside at the forest root while the Domain Admins group exists for every domain in the forest.  This meant I would need to enumerate every domain and depending on the domain, enumerate either all three groups or just one.<span id="more-247"></span></p>
<p>My thinking was overly complex and I realized this halfway through writing a new script.  Using the power of LDAP, I can use a logical &#8220;or&#8221; (|) statement.  When run against a domain, it would always return &#8220;Domain Admins&#8221; since it will always exist in an AD domain.  When it is run against the forest root domain, it would also return the &#8220;Enterprise Admins&#8221; group and &#8220;Schema Admins&#8221; group.  Here is the LDAP query:</p>
<p><code>(&amp;(objectCategory=group)(|((name=Enterprise Admins*)(name=Domain Admins*)(name=Schema Admins*))))</code></p>
<p>At this point, all I need to do is this:</p>
<ol>
<li>Enumerate all domains in the forest</li>
<li>Loop through each domain</li>
<li>Execute LDAP query against each domain</li>
<li>Loop through LDAP query results</li>
<li>Dump membership of each group</li>
</ol>
<p>The script below does just that.  I hope some find it useful.  There is no configuration necessary.  You should be able to just run it from your environment as no domain references (or really anything) is hard coded.  The only thing you may want to add to or remove from is the LDAP filter.  Cheers!</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">'==========================================================================
</span><span style="color: #008000;">' VBScript Source File
</span><span style="color: #008000;">' NAME: Active Directory Admin Audit
</span><span style="color: #008000;">' AUTHOR: Andrew J Healey
</span><span style="color: #008000;">' DATE  : 2009.04.16
</span><span style="color: #008000;">' COMMENT: This script will check all the domains within a forest
</span><span style="color: #008000;">'		and report all the members of the following groups: Schema
</span><span style="color: #008000;">'		Admins, Enterprise Admins and Domain Admins. See notes to
</span><span style="color: #008000;">'		expand on the groups.
</span><span style="color: #008000;">'==========================================================================
</span>
<span style="color: #008000;">'Define Constants
</span><span style="color: #000080;">Const</span> adUseClient = 3
<span style="color: #000080;">Const</span> ForWriting = 2
&nbsp;
<span style="color: #008000;">'Set the path and filename for the dump of sensitive users
</span><span style="color: #008000;">'  Folder must exist!
</span>fileTemp = <span style="color: #800000;">&quot;C:\AD Admin Audit.txt&quot;</span>
&nbsp;
<span style="color: #008000;">'Create tmp file and report file
</span><span style="color: #000080;">Set</span> objFSO = CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
<span style="color: #000080;">Set</span> objTempFile = objFSO.OpenTextFile(fileTemp, ForWriting, <span style="color: #000080;">True</span>)
&nbsp;
<span style="color: #008000;">'Query RootDSE and return array with all AD domains in forest
</span><span style="color: #000080;">Set</span> adoComm = CreateObject(<span style="color: #800000;">&quot;ADODB.Command&quot;</span>)
<span style="color: #000080;">Set</span> adoConn = CreateObject(<span style="color: #800000;">&quot;ADODB.Connection&quot;</span>)
adoConn.Provider = <span style="color: #800000;">&quot;ADsDSOObject&quot;</span>
adoConn.cursorLocation = adUseClient
adoConn.<span style="color: #000080;">Open</span> <span style="color: #800000;">&quot;Active Directory Provider&quot;</span>
adoComm.ActiveConnection = adoConn
&nbsp;
<span style="color: #000080;">Set</span> objRootDSE = GetObject(<span style="color: #800000;">&quot;LDAP://RootDSE&quot;</span>)
strBase   =  <span style="color: #800000;">&quot;&lt;GC://&quot;</span> &amp; objRootDSE.<span style="color: #000080;">Get</span>(<span style="color: #800000;">&quot;rootDomainNamingContext&quot;</span>) &amp; <span style="color: #800000;">&quot;&gt;;&quot;</span>
strFilter = <span style="color: #800000;">&quot;(objectcategory=domainDNS);&quot;</span>
strAttrs  = <span style="color: #800000;">&quot;distinguishedName;&quot;</span>
strScope  = <span style="color: #800000;">&quot;subtree&quot;</span>
&nbsp;
strQuery = strBase &amp;amp; strFilter &amp;amp; strAttrs &amp;amp; strScope
adoComm.CommandText = strQuery
adoComm.Properties(<span style="color: #800000;">&quot;Page Size&quot;</span>) = 50
adoComm.Properties(<span style="color: #800000;">&quot;Timeout&quot;</span>) = 30
adoComm.Properties(<span style="color: #800000;">&quot;Cache Results&quot;</span>) = <span style="color: #000080;">False</span>
&nbsp;
<span style="color: #000080;">Set</span> adoRS = adoComm.Execute
&nbsp;
<span style="color: #008000;">'Start Loop
</span><span style="color: #000080;">Do</span> <span style="color: #000080;">Until</span> adoRS.EOF
	<span style="color: #008000;">'Parse ad search results to create well formed DNS domain
</span>	strDomain = Replace(adoRS.Fields(0).Value,<span style="color: #800000;">&quot;DC=&quot;</span>,<span style="color: #800000;">&quot;&quot;</span>)
	strDomain = Replace(strDomain,<span style="color: #800000;">&quot;,&quot;</span>,<span style="color: #800000;">&quot;.&quot;</span>)
	<span style="color: #000080;">Call</span> GrpAll(strDomain)
	adoRS.MoveNext
<span style="color: #000080;">Loop</span>
adoRS.<span style="color: #000080;">Close</span>
adoConn.<span style="color: #000080;">Close</span>
wscript.quit
&nbsp;
<span style="color: #000080;">Function</span> GrpAll(x)
	<span style="color: #008000;">'To search for more groups, edit the &quot;strFilter&quot; line. It uses a simple
</span>	<span style="color: #008000;">' LDAP or (|) so multiple groups can be added. It uses ADO record sets
</span>	<span style="color: #008000;">' to loop so it doesn't have to find all of them, just one. Every domain
</span>	<span style="color: #008000;">' will contain at least the Domain Admins group.
</span>	<span style="color: #000080;">Set</span> adoCommand = CreateObject(<span style="color: #800000;">&quot;ADODB.Command&quot;</span>)
	<span style="color: #000080;">Set</span> adoConnection = CreateObject(<span style="color: #800000;">&quot;ADODB.Connection&quot;</span>)
	adoConnection.Provider = <span style="color: #800000;">&quot;ADsDSOObject&quot;</span>
	adoConnection.cursorLocation = adUseClient
	adoConnection.<span style="color: #000080;">Open</span> <span style="color: #800000;">&quot;Active Directory Provider&quot;</span>
	adoCommand.ActiveConnection = adoConnection
&nbsp;
	strBase   = <span style="color: #800000;">&quot;;&quot;</span>
	strFilter = <span style="color: #800000;">&quot;(&amp;amp;(objectCategory=group)(|((name=Enterprise Admins*)&quot;</span> &amp;amp; _
				<span style="color: #800000;">&quot;(name=Domain Admins*)(name=Schema Admins*))));&quot;</span>
	strAttrs  = <span style="color: #800000;">&quot;name,member;&quot;</span>
	strScope  = <span style="color: #800000;">&quot;subtree&quot;</span>
&nbsp;
	strQuery = strBase &amp;amp; strFilter &amp;amp; strAttrs &amp;amp; strScope
	adoCommand.CommandText = strQuery
	adoCommand.Properties(<span style="color: #800000;">&quot;Page Size&quot;</span>) = 5000
	adoCommand.Properties(<span style="color: #800000;">&quot;Timeout&quot;</span>) = 30
	adoCommand.Properties(<span style="color: #800000;">&quot;Cache Results&quot;</span>) = <span style="color: #000080;">False</span>
&nbsp;
	<span style="color: #000080;">Set</span> adoRecordset = adoCommand.Execute
&nbsp;
	objTempFile.WriteLine <span style="color: #800000;">&quot;Group report for domain: &quot;</span> &amp;amp; x
&nbsp;
	adoRecordset.MoveFirst
&nbsp;
	<span style="color: #000080;">Do</span> <span style="color: #000080;">Until</span> adoRecordset.EOF
	    objTempFile.WriteLine vbTab &amp;amp; adoRecordset.Fields(0).Value
		<span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> strMember <span style="color: #000080;">in</span> adoRecordset.Fields(1).Value
			objTempFile.WriteLine vbTab &amp;amp; vbTab &amp;amp; strMember
		<span style="color: #000080;">Next</span>
	    adoRecordset.MoveNext
	<span style="color: #000080;">Loop</span>
&nbsp;
	adoRecordset.<span style="color: #000080;">Close</span>
	adoConnection.<span style="color: #000080;">Close</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/&amp;t=vbScript+-+List+All+Members+Of+Sensitive+Groups%3A+Schema%2C+Enterprise+and+Domain+Admins" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/&amp;title=vbScript+-+List+All+Members+Of+Sensitive+Groups%3A+Schema%2C+Enterprise+and+Domain+Admins&amp;summary=Update%202009.04.16%3A%20At%20the%20request%20of%20a%20commenter%2C%20I%20added%20a%20couple%20lines%20to%20the%20script%20that%20will%20dump%20the%20output%20to%20a%20text%20file%20in%20the%20root%20of%20the%20C%3A%20drive.%20%20I%20also%20corrected%20a%20couple%20errors%20in%20the%20script.%0D%0A%0D%0AI%20was%20tasked%20to%20get%20a%20dump%20of%20all%20the%20users%20in%20our%20Schema%20Admins%2C%20Enterprise%20Admins%20and%20Dom&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=vbScript+-+List+All+Members+Of+Sensitive+Groups%3A+Schema%2C+Enterprise+and+Domain+A%5B..%5D+-+http://b2l.me/b4gfd&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=vbScript+-+List+All+Members+Of+Sensitive+Groups%3A+Schema%2C+Enterprise+and+Domain+Admins&amp;du=http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/&amp;cn=Update%202009.04.16%3A%20At%20the%20request%20of%20a%20commenter%2C%20I%20added%20a%20couple%20lines%20to%20the%20script%20that%20will%20dump%20the%20output%20to%20a%20text%20file%20in%20the%20root%20of%20the%20C%3A%20drive.%20%20I%20also%20corrected%20a%20couple%20errors%20in%20the%20script.%0D%0A%0D%0AI%20was%20tasked%20to%20get%20a%20dump%20of%20all%20the%20users%20in%20our%20Schema%20Admins%2C%20Enterprise%20Admins%20and%20Dom" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/&amp;title=vbScript+-+List+All+Members+Of+Sensitive+Groups%3A+Schema%2C+Enterprise+and+Domain+Admins" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/&amp;submitHeadline=vbScript+-+List+All+Members+Of+Sensitive+Groups%3A+Schema%2C+Enterprise+and+Domain+Admins&amp;submitSummary=Update%202009.04.16%3A%20At%20the%20request%20of%20a%20commenter%2C%20I%20added%20a%20couple%20lines%20to%20the%20script%20that%20will%20dump%20the%20output%20to%20a%20text%20file%20in%20the%20root%20of%20the%20C%3A%20drive.%20%20I%20also%20corrected%20a%20couple%20errors%20in%20the%20script.%0D%0A%0D%0AI%20was%20tasked%20to%20get%20a%20dump%20of%20all%20the%20users%20in%20our%20Schema%20Admins%2C%20Enterprise%20Admins%20and%20Dom&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22vbScript%20-%20List%20All%20Members%20Of%20Sensitive%20Groups%3A%20Schema%2C%20Enterprise%20and%20Domain%20Admins%22&amp;body=Link: http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Update%202009.04.16%3A%20At%20the%20request%20of%20a%20commenter%2C%20I%20added%20a%20couple%20lines%20to%20the%20script%20that%20will%20dump%20the%20output%20to%20a%20text%20file%20in%20the%20root%20of%20the%20C%3A%20drive.%20%20I%20also%20corrected%20a%20couple%20errors%20in%20the%20script.%0D%0A%0D%0AI%20was%20tasked%20to%20get%20a%20dump%20of%20all%20the%20users%20in%20our%20Schema%20Admins%2C%20Enterprise%20Admins%20and%20Dom" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/vbscript-list-all-members-of-sensitive-groups-schema-enterprise-and-domain-admins/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>SNMP In A Windows Environment</title>
		<link>http://halfloaded.com/blog/snmp-in-a-windows-environment/</link>
		<comments>http://halfloaded.com/blog/snmp-in-a-windows-environment/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 19:57:55 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://halfloaded.com/blog/snmp-in-a-windows-environment/</guid>
		<description><![CDATA[The difficult part with managing SNMP via Group Policy is that SNMP is not installed by default. The first step is to install SNMP on all the machines you want to monitor via SNMP. This can be managed a couple ways. The simplest method that I have used is the one Zenoss recommends. If you [...]]]></description>
			<content:encoded><![CDATA[<p>The difficult part with managing SNMP via Group Policy is that SNMP is not installed by default.  The first step is to install SNMP on all the machines you want to monitor via SNMP.  This can be managed a couple ways.  The simplest method that I have used is the one <a title="Zenoss recommends" href="http://www.zenoss.com/community/docs/howtos/install-snmp-on-windows-remotely/">Zenoss recommends</a>.  If you only have a couple of machines to install SNMP on, it may be easier just to go into the Add/Remove Programs &#8211;&gt; Add/Remove Windows Components &#8211;&gt; Management and Monitoring Tools &#8211;&gt; Simple Network Monitoring Protocol.<span id="more-246"></span></p>
<p>Once SNMP is setup, you need to create a custom ADM template to manage the SNMP settings via Group Policy.  This sounds more difficult that it really is.  The bonus is that once you see it done a time or two, you really start to understand the power in home made ADM templates.  I would checkout the <a href="http://www.mail-archive.com/activedir@mail.activedir.org/msg46539.html">mailing list at ActiveDir.org</a> and the information available on <a href="http://www.petri.co.il/adding_new_administrative_templates_to_gpo.htm">petri.co.il</a>.  Both of these resources are invaluable for getting things done in Windows and Active Directory.</p>
<p>If you just want to manually control the SNMP settings, just go: Start &#8211;&gt; Run &#8211;&gt; Services.msc.  Select the SNMP service, right click and select Properties and click on the security tab.  All your communities can be managed through that tab.</p>
<p>Unfortunately, MS didn&#8217;t make SNMP as easy to implement in Windows as *nix environments have.  However, setting it up on Windows is a good experience and all the work will pay off in spades once it is complete.</p>
<p>As for monitoring packages, check out <a href="http://www.zenoss.com/">Zenoss</a> and <a href="http://www.zabbix.com/">Zabbix</a>.  I&#8217;m all for the open source, service support model of software development and these two have proven it is a viable means of running a productive and profitable software development business.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/snmp-in-a-windows-environment/&amp;t=SNMP+In+A+Windows+Environment" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/snmp-in-a-windows-environment/&amp;title=SNMP+In+A+Windows+Environment&amp;summary=The%20difficult%20part%20with%20managing%20SNMP%20via%20Group%20Policy%20is%20that%20SNMP%20is%20not%20installed%20by%20default.%20%20The%20first%20step%20is%20to%20install%20SNMP%20on%20all%20the%20machines%20you%20want%20to%20monitor%20via%20SNMP.%20%20This%20can%20be%20managed%20a%20couple%20ways.%20%20The%20simplest%20method%20that%20I%20have%20used%20is%20the%20one%20Zenoss%20recommends.%20%20If%20you%20only%20h&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=SNMP+In+A+Windows+Environment+-+http://b2l.me/b4gfe&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=SNMP+In+A+Windows+Environment&amp;du=http://halfloaded.com/blog/snmp-in-a-windows-environment/&amp;cn=The%20difficult%20part%20with%20managing%20SNMP%20via%20Group%20Policy%20is%20that%20SNMP%20is%20not%20installed%20by%20default.%20%20The%20first%20step%20is%20to%20install%20SNMP%20on%20all%20the%20machines%20you%20want%20to%20monitor%20via%20SNMP.%20%20This%20can%20be%20managed%20a%20couple%20ways.%20%20The%20simplest%20method%20that%20I%20have%20used%20is%20the%20one%20Zenoss%20recommends.%20%20If%20you%20only%20h" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/snmp-in-a-windows-environment/&amp;title=SNMP+In+A+Windows+Environment" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/snmp-in-a-windows-environment/&amp;submitHeadline=SNMP+In+A+Windows+Environment&amp;submitSummary=The%20difficult%20part%20with%20managing%20SNMP%20via%20Group%20Policy%20is%20that%20SNMP%20is%20not%20installed%20by%20default.%20%20The%20first%20step%20is%20to%20install%20SNMP%20on%20all%20the%20machines%20you%20want%20to%20monitor%20via%20SNMP.%20%20This%20can%20be%20managed%20a%20couple%20ways.%20%20The%20simplest%20method%20that%20I%20have%20used%20is%20the%20one%20Zenoss%20recommends.%20%20If%20you%20only%20h&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/snmp-in-a-windows-environment/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/snmp-in-a-windows-environment/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22SNMP%20In%20A%20Windows%20Environment%22&amp;body=Link: http://halfloaded.com/blog/snmp-in-a-windows-environment/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A The%20difficult%20part%20with%20managing%20SNMP%20via%20Group%20Policy%20is%20that%20SNMP%20is%20not%20installed%20by%20default.%20%20The%20first%20step%20is%20to%20install%20SNMP%20on%20all%20the%20machines%20you%20want%20to%20monitor%20via%20SNMP.%20%20This%20can%20be%20managed%20a%20couple%20ways.%20%20The%20simplest%20method%20that%20I%20have%20used%20is%20the%20one%20Zenoss%20recommends.%20%20If%20you%20only%20h" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/snmp-in-a-windows-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
