<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Alex Sarafian as Developer &#187; Active Directory</title>
	<atom:link href="http://sarafianalex.wordpress.com/category/active-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://sarafianalex.wordpress.com</link>
	<description>Adventures in C# Land and some SQL</description>
	<lastBuildDate>Fri, 04 Sep 2009 11:27:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sarafianalex.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ea38bb69738d229a89ab00b82aad64b7?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Alex Sarafian as Developer &#187; Active Directory</title>
		<link>http://sarafianalex.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sarafianalex.wordpress.com/osd.xml" title="Alex Sarafian as Developer" />
		<item>
		<title>DirectoryEntry Enabled</title>
		<link>http://sarafianalex.wordpress.com/2008/08/27/directoryentry-enabled/</link>
		<comments>http://sarafianalex.wordpress.com/2008/08/27/directoryentry-enabled/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 13:52:12 +0000</pubDate>
		<dc:creator>Sarafian Alex</dc:creator>
				<category><![CDATA[.NET C#]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://sarafianalex.wordpress.com/2008/08/27/directoryentry-enabled/</guid>
		<description><![CDATA[I need to check whether an account in the active directory was enabled.
After some searching, I came to understand that the enabled feature is not only for User but for every node in the active directory. That means every DirectoryEntry instance.
Here is how you check if it is enabled
public const string     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarafianalex.wordpress.com&blog=2367780&post=33&subd=sarafianalex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I need to check whether an account in the active directory was enabled.</p>
<p>After some searching, I came to understand that the enabled feature is not only for User but for every node in the active directory. That means every DirectoryEntry instance.</p>
<p>Here is how you check if it is enabled</p>
<blockquote><pre class="code"><span style="color:blue;">public const string        </span>AccountControl=<span style="color:#a31515;">"userAccountControl"</span>;
<span style="color:blue;">public const int EnabledFlag</span>= 0x2;</pre>
<pre class="code"><span style="color:blue;">static bool </span>IsEnabled(<span style="color:#2b91af;">DirectoryEntry </span>de)
{
<span style="color:blue;">  return </span>(((<span style="color:blue;">int</span>)</pre>
<pre class="code">  de.Properties[AccountControl].Value)</pre>
<pre class="code">  &amp; EnabledFlag) == 0;
}</pre>
</blockquote>
<pre class="code"><font color="#777777"></font>&nbsp;</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sarafianalex.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sarafianalex.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarafianalex.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarafianalex.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarafianalex.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarafianalex.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarafianalex.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarafianalex.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarafianalex.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarafianalex.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarafianalex.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarafianalex.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarafianalex.wordpress.com&blog=2367780&post=33&subd=sarafianalex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sarafianalex.wordpress.com/2008/08/27/directoryentry-enabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64f00567ef7dda3ec36dcf0e01043d11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sarafian</media:title>
		</media:content>
	</item>
		<item>
		<title>Active Directory Connection</title>
		<link>http://sarafianalex.wordpress.com/2008/08/27/active-directory-connection/</link>
		<comments>http://sarafianalex.wordpress.com/2008/08/27/active-directory-connection/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 13:45:33 +0000</pubDate>
		<dc:creator>Sarafian Alex</dc:creator>
				<category><![CDATA[.NET C#]]></category>
		<category><![CDATA[Active Directory]]></category>

		<guid isPermaLink="false">http://sarafianalex.wordpress.com/2008/08/27/active-directory-connection/</guid>
		<description><![CDATA[Recently I have been asked to query our Active Directory.
I really believe that the documentation is really poor about the connection, and what the errors mean.
After all the problems, and the never ending errors that I could not comprehend, I stumped upon a post that said LDAP prefix must be Uppercase. 
A few thing about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarafianalex.wordpress.com&blog=2367780&post=31&subd=sarafianalex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">Recently I have been asked to query our Active Directory.</p>
<p align="justify">I really believe that the documentation is really poor about the connection, and what the errors mean.</p>
<p align="justify">After all the problems, and the never ending errors that I could not comprehend, I stumped upon a post that said <strong>LDAP prefix must be Uppercase</strong>. </p>
<p align="justify">A few thing about the connection string, since I am writing this post.</p>
<p align="justify">I do not know of Active Directory administration so, what I will write here is my experience in this situation and hopefully someone will benefit.</p>
<p align="justify">At my company we have a domain which from windows we see as DomainName. There are a few places in windows, that I had seen a <strong>local</strong> suffix in out domain. I do not know what this means. Our domain is located on machine called SERV1 for example with IP 192.168.0.1. </p>
<p align="justify">In case I&#8217;m not entirely clear about my environment, let me specify that my computer registers on the network as DomainName\PCName and my Domain Account is DomainName\sarafian.</p>
<p align="justify">The only valid connection string that works for us is <a title="//192.168.0.100/dc=ORAMA-ATH,dc=local" href="//192.168.0.1/dc=DomainName,dc=local">LDAP://192.168.0.1/dc=DomainName,dc=local</a></p>
<p align="justify">Anything else just doesn&#8217;t.</p>
<p align="justify">Here is the creation of root DirectoryEntry</p>
<blockquote><pre class="code"><span style="color:blue;">private static </span><span style="color:#2b91af;">DirectoryEntry </span>GetRoot()
{
    <span style="color:#2b91af;">DirectoryEntry </span>de = <span style="color:blue;">new </span><span style="color:#2b91af;">DirectoryEntry</span>(</pre>
<pre class="code">      "<a title="//192.168.0.100/dc=ORAMA-ATH,dc=local" href="//192.168.0.1/dc=DomainName,dc=local">LDAP://192.168.0.1/dc=DomainName,dc=local</a>"</pre>
<pre class="code">     , <span style="color:blue;">null</span>, <span style="color:blue;">null</span>, <span style="color:#2b91af;">AuthenticationTypes</span>.Secure);
    <span style="color:blue;">return </span>de;
}</pre>
</blockquote>
<p align="justify">Hopefully someone will benefit and won&#8217;t get frustrated as I did, with all the combinations and their incomprehensive error messages.</p>
<p align="justify">&nbsp;</p>
<p align="justify">
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/sarafianalex.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/sarafianalex.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarafianalex.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarafianalex.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarafianalex.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarafianalex.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarafianalex.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarafianalex.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarafianalex.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarafianalex.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarafianalex.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarafianalex.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarafianalex.wordpress.com&blog=2367780&post=31&subd=sarafianalex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sarafianalex.wordpress.com/2008/08/27/active-directory-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64f00567ef7dda3ec36dcf0e01043d11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sarafian</media:title>
		</media:content>
	</item>
	</channel>
</rss>