<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>LINQ to Active Directory</title><link>http://linqtoad.codeplex.com/project/feeds/rss</link><description>LINQ to Active Directory implements a custom LINQ query provider that allows querying objects in Active Directory. Internally, queries are translated into LDAP filters which are sent to the server using the System.DirectoryServices .NET Framework library.</description><item><title>New Post: anr (ambiguous name resolution) query or other special queries</title><link>http://linqtoad.codeplex.com/discussions/415142</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Are &lt;a href="http://support.microsoft.com/kb/243299"&gt;anr&lt;/a&gt; queries supported? What about the
&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa746475(v=vs.85).aspx"&gt;
&lt;span&gt;matching rule OIDs for&lt;/span&gt;&amp;nbsp;bitwise comparisons&lt;/a&gt;? For example, I can include only Active users with this&amp;nbsp;(!(userAccountControl:1.2.840.113556.1.4.803:=2)) or only security groups with&amp;nbsp;(groupType:1.2.840.113556.1.4.803:=2147483648)
 (&lt;a href="http://social.technet.microsoft.com/wiki/contents/articles/5392.active-directory-ldap-syntax-filters.aspx"&gt;more examples&lt;/a&gt;). Are there other ways to perform these kind of filters?&lt;/p&gt;
&lt;/div&gt;</description><author>dotjoe</author><pubDate>Fri, 21 Dec 2012 15:13:36 GMT</pubDate><guid isPermaLink="false">New Post: anr (ambiguous name resolution) query or other special queries 20121221031336P</guid></item><item><title>Source code checked in, #81799</title><link>http://linqtoad.codeplex.com/SourceControl/changeset/changes/81799</link><description>Upgrade&amp;#58; New Version of LabDefaultTemplate.xaml. To upgrade your build definitions, please visit the following link&amp;#58; http&amp;#58;&amp;#47;&amp;#47;go.microsoft.com&amp;#47;fwlink&amp;#47;&amp;#63;LinkId&amp;#61;254563</description><author>Project Collection Service Accounts</author><pubDate>Mon, 01 Oct 2012 21:57:23 GMT</pubDate><guid isPermaLink="false">Source code checked in, #81799 20121001095723P</guid></item><item><title>Source code checked in, #81798</title><link>http://linqtoad.codeplex.com/SourceControl/changeset/changes/81798</link><description>Checked in by server upgrade</description><author>Project Collection Service Accounts</author><pubDate>Mon, 01 Oct 2012 21:51:05 GMT</pubDate><guid isPermaLink="false">Source code checked in, #81798 20121001095105P</guid></item><item><title>Commented Issue: Trying to get all users in a group is limited to 1500 records [6172]</title><link>http://linqtoad.codeplex.com/workitem/6172</link><description>When I do a query to get all users in a group like the one below &amp;#40;where &amp;#34;MyGroups&amp;#34; is AD Groups&amp;#41;&amp;#58;&lt;br /&gt;                var res &amp;#61; from i in ctx.MyGroups&lt;br /&gt;                          where i.Name &amp;#61;&amp;#61; GroupName&lt;br /&gt;                          select i.Members&amp;#59;&lt;br /&gt;The results are limited to 1500 records.  I believe there is some way to get around this limitation of the Directory Searcher using the &amp;#34;range&amp;#34;&amp;#58; &lt;br /&gt;&lt;br /&gt;DirectorySearcher groupMember &amp;#61; new DirectorySearcher&lt;br /&gt;    &amp;#40;group,&amp;#34;&amp;#40;objectClass&amp;#61;&amp;#42;&amp;#41;&amp;#34;,new string&amp;#91;&amp;#93;&amp;#123;&amp;#34;member&amp;#59;Range&amp;#61;0-500&amp;#34;&amp;#125;,SearchScope.Base&amp;#41;&amp;#59;&lt;br /&gt; &amp;#40;http&amp;#58;&amp;#47;&amp;#47;bcheul.tistory.com&amp;#47;archive&amp;#47;200811&amp;#41;&lt;br /&gt;&lt;br /&gt;It would be nice if your LINQ provider knew when it had hit 1500, then did another query for the next 1500 and so on until it had all users, then merged the results into the one list.  At the moment I am going to have to try and do this manually.&lt;br /&gt;Comments: ** Comment from web user: jay_burling ** &lt;p&gt;This has to do with the paging of results returned from AD. If you wrap the FindAll&amp;#40;&amp;#41; call in DirectoryQuery&amp;#60;T&amp;#62;.GetResults&amp;#40;&amp;#41; with a using and set a page size, it will continue until it retrieves all the results. Something like&amp;#58;&lt;/p&gt;&lt;p&gt;using &amp;#40; var s &amp;#61; new DirectorySearcher&amp;#40; root, q, properties.ToArray&amp;#40;&amp;#41;, _source.Scope &amp;#41; &amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;           s.PageSize &amp;#61; 1000&amp;#59;&lt;br /&gt;           ...&lt;br /&gt;           foreach &amp;#40;SearchResult sr in s.FindAll&amp;#40;&amp;#41;&amp;#41;&lt;br /&gt;           ...&lt;br /&gt;&amp;#125;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><author>jay_burling</author><pubDate>Mon, 30 Apr 2012 14:41:38 GMT</pubDate><guid isPermaLink="false">Commented Issue: Trying to get all users in a group is limited to 1500 records [6172] 20120430024138P</guid></item><item><title>New Post: how to use linq "Take()" statement</title><link>http://linqtoad.codeplex.com/discussions/312325</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;1)&lt;/p&gt;
&lt;p&gt;Take isn't supported, but it's pretty easy to add it yourself. &amp;nbsp;All of these changes are made to the DirectorySource class. &amp;nbsp;Just create a nullable class variable that gets set in the Parse method for Take. &amp;nbsp;I've highlighted the changes below:&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Parse(Expression ex)
{
	&lt;span style="color: blue;"&gt;var&lt;/span&gt; ce = ex &lt;span style="color: blue;"&gt;as&lt;/span&gt; ConstantExpression;
	&lt;span style="color: blue;"&gt;var&lt;/span&gt; mce = ex &lt;span style="color: blue;"&gt;as&lt;/span&gt; MethodCallExpression;

	&lt;span style="color: blue;"&gt;if&lt;/span&gt; (ce != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
	{
		_source = ce.Value &lt;span style="color: blue;"&gt;as&lt;/span&gt; IDirectorySource;
                originalType = _source.OriginalType;
        }
        &lt;span style="color: blue;"&gt;else&lt;/span&gt; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (mce != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
        {
                &lt;span style="color: green;"&gt;//&lt;/span&gt;
                &lt;span style="color: green;"&gt;// Should be extension methods on Queryable.&lt;/span&gt;
                &lt;span style="color: green;"&gt;//&lt;/span&gt;
                &lt;span style="color: blue;"&gt;if&lt;/span&gt; (mce.Method.DeclaringType != &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(Queryable))
                    &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; NotSupportedException(&lt;span style="color: #a31515;"&gt;"Detected invalid top-level method-call."&lt;/span&gt;);

                Parse(mce.Arguments[0]);

                &lt;span style="color: green;"&gt;//&lt;/span&gt;
                &lt;span style="color: green;"&gt;// First parameter to the method call represents the (unary) lambda in LINQ style.&lt;/span&gt;
                &lt;span style="color: green;"&gt;// E.g. (user =&amp;gt; user.Name == "Bart") for a Where  clause&lt;/span&gt;
                &lt;span style="color: green;"&gt;//      (user =&amp;gt; new { user.Name })   for a Select clause&lt;/span&gt;
                &lt;span style="color: green;"&gt;//&lt;/span&gt;
                &lt;span style="color: blue;"&gt;switch&lt;/span&gt; (mce.Method.Name)
                {
                    &lt;span style="color: green;"&gt;//&lt;/span&gt;
                    &lt;span style="color: green;"&gt;// Builds the query LDAP expression.&lt;/span&gt;
                    &lt;span style="color: green;"&gt;//&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"Where"&lt;/span&gt;:
                        BuildPredicate(((UnaryExpression)mce.Arguments[1]).Operand &lt;span style="color: blue;"&gt;as&lt;/span&gt; LambdaExpression);
                        &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
                    &lt;span style="color: green;"&gt;//&lt;/span&gt;
                    &lt;span style="color: green;"&gt;// Builds the projection and filters the required properties.&lt;/span&gt;
                    &lt;span style="color: green;"&gt;//&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;"Select"&lt;/span&gt;:
                        BuildProjection(((UnaryExpression)mce.Arguments[1]).Operand &lt;span style="color: blue;"&gt;as&lt;/span&gt; LambdaExpression);
                        &lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="background-color: white;"&gt;	            &lt;/span&gt;&lt;span style="color: #ff00ff;"&gt;&lt;strong&gt;case "Take":&lt;/strong&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="color: #ff00ff;"&gt;&lt;strong&gt;			_takeValue = (int)((ConstantantExpression)mce.Arguments[1]).Value;
		        break;&lt;/strong&gt;&lt;/span&gt;
                    &lt;span style="color: blue;"&gt;default&lt;/span&gt;:
                        &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; NotSupportedException(&lt;span style="color: #a31515;"&gt;"Unsupported query operator: "&lt;/span&gt; + mce.Method.Name);
                }
        }
	&lt;span style="color: blue;"&gt;else&lt;/span&gt;
                &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; NotSupportedException(&lt;span style="color: #a31515;"&gt;"Invalid expression node detected."&lt;/span&gt;);
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Once that's done you just need to check it and set it when you perform a search:&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; IEnumerator&amp;lt;T&amp;gt; GetResults()
{
    DirectorySchemaAttribute[] attr = (DirectorySchemaAttribute[])originalType.GetCustomAttributes(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(DirectorySchemaAttribute), &lt;span style="color: blue;"&gt;false&lt;/span&gt;);
    &lt;span style="color: blue;"&gt;if&lt;/span&gt; (attr == &lt;span style="color: blue;"&gt;null&lt;/span&gt; || attr.Length == 0)
        &lt;span style="color: blue;"&gt;throw&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; InvalidOperationException(&lt;span style="color: #a31515;"&gt;"Missing schema mapping attribute."&lt;/span&gt;);

    &lt;span style="color: blue;"&gt;string&lt;/span&gt; classQuery = String.Format(&lt;span style="color: #a31515;"&gt;"(objectClass={0})"&lt;/span&gt;, attr[0].Schema);

    DirectorySearcher s = Helpers.CloneSearcher(
        _source.Searcher,
        !&lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(query) ? String.Format(&lt;span style="color: #a31515;"&gt;"(&amp;amp;{0}{1})"&lt;/span&gt;, classQuery, query) : classQuery,
        properties.ToArray()
    );
    &lt;span style="color: #ff00ff;"&gt;&lt;strong&gt;if (_takeValue.HasValue) s.SizeLimit = _takeValue.Value;&lt;/strong&gt;&lt;/span&gt;

    &lt;span style="color: green;"&gt;//rest of method to perform search...&lt;/span&gt;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As for paging the results, LDAP doesn't really support paging the way LINQ expects it to work. &amp;nbsp;Paging is kind of abstracted away and only exposed through a cookie returned from the server. &amp;nbsp;You can read more about it here: &lt;a href="http://tools.ietf.org/html/rfc2696"&gt;http://tools.ietf.org/html/rfc2696&lt;/a&gt;. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can tell the DirectorySearcher to get everything by setting a sufficiently large PageSize, but getting a subset and then going to get more is not possible from what I can tell.&lt;/p&gt;
&lt;p&gt;2)&lt;/p&gt;
&lt;p&gt;You can filter by group. &amp;nbsp;Just map the memberOf property as a string[] and do something like this:&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;context.Where(u =&amp;gt; u.memberOf.Contains("[distinguished name of &lt;span style="color: #000000;"&gt;group&lt;/span&gt;]"))
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This will find all users that are a member of that group.&lt;/p&gt;&lt;/div&gt;</description><author>madhatter22</author><pubDate>Sat, 25 Feb 2012 14:21:51 GMT</pubDate><guid isPermaLink="false">New Post: how to use linq "Take()" statement 20120225022151P</guid></item><item><title>New Post: Get user list but ...</title><link>http://linqtoad.codeplex.com/discussions/272416</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Yes. You just need to model your you DirectoryEntity for your ADUser like so:&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;[DirectorySchema(&lt;span style="color: #a31515;"&gt;"user"&lt;/span&gt;, &lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(IADsUser))]
&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; ADUser : DirectoryEntity
{
	[DirectoryAttribute(&lt;span style="color: #a31515;"&gt;"givenName"&lt;/span&gt;)]
	&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; FirstName { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
	
	[DirectoryAttribute(&lt;span style="color: #a31515;"&gt;"Mail"&lt;/span&gt;)]
	&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; EmailAddress { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
	
	[DirectoryAttribute(&lt;span style="color: #a31515;"&gt;"sn"&lt;/span&gt;)]
	&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; LastName { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
	
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description><author>anAgent</author><pubDate>Fri, 17 Feb 2012 00:18:36 GMT</pubDate><guid isPermaLink="false">New Post: Get user list but ... 20120217121836A</guid></item><item><title>New Post: Get groups from OU</title><link>http://linqtoad.codeplex.com/discussions/272408</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I think this is basically what' you're looking for.&lt;/p&gt;
&lt;p&gt;1) Create the Group class modeling from the example provided in this framework:&lt;/p&gt;
&lt;p&gt;2) Create a basic Context class;&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;    &lt;span style="color: blue;"&gt;sealed&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; MyContext : DirectoryContext
    {
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; MyContext(DirectoryEntry searchRoot)
            : &lt;span style="color: blue;"&gt;base&lt;/span&gt;(searchRoot)
        {
        }
        [DirectorySearchOptions(SearchScope.Subtree)]
        &lt;span style="color: blue;"&gt;public&lt;/span&gt; DirectorySource&amp;lt;ADGroup&amp;gt; Groups { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
    }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;3) Query you data. Just sent the OU path to where you want to query.&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;	
MyContext ctx = &lt;span style="color: blue;"&gt;new&lt;/span&gt; MyContext(&lt;span style="color: blue;"&gt;new&lt;/span&gt; DirectoryEntry(&lt;span style="color: #a31515;"&gt;"LDAP://OU=Users,OU=TEST,DC=mydc,DC=com"&lt;/span&gt;)); 

&lt;span style="color: blue;"&gt;var&lt;/span&gt; groups = &lt;span style="color: blue;"&gt;from&lt;/span&gt; x &lt;span style="color: blue;"&gt;in&lt;/span&gt; ctx.Groups
		 &lt;span style="color: blue;"&gt;where&lt;/span&gt; x.Name.StartsWith(&lt;span style="color: #a31515;"&gt;"Test"&lt;/span&gt;)
		 &lt;span style="color: blue;"&gt;select&lt;/span&gt; x;

&lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue;"&gt;var&lt;/span&gt; g &lt;span style="color: blue;"&gt;in&lt;/span&gt; groups)
{
Console.WriteLine(g.Name);
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>anAgent</author><pubDate>Fri, 17 Feb 2012 00:16:44 GMT</pubDate><guid isPermaLink="false">New Post: Get groups from OU 20120217121644A</guid></item><item><title>New Post: how to use linq "Take()" statement</title><link>http://linqtoad.codeplex.com/discussions/312325</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;linq take statement is not supported in this project&lt;/p&gt;
&lt;p&gt;any one have idea how to query first 20 (grid pagesize) from linq to ad queury?&lt;/p&gt;
&lt;p&gt;and when page index change load next 20 results?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;other limitation i cant filter by group (memberOf)&lt;/p&gt;
&lt;p&gt;Any one has an idea how to filter by group?&lt;/p&gt;
&lt;p&gt;tahnk you very much for your help&lt;/p&gt;
&lt;/div&gt;</description><author>touhami</author><pubDate>Tue, 14 Feb 2012 13:20:25 GMT</pubDate><guid isPermaLink="false">New Post: how to use linq "Take()" statement 20120214012025P</guid></item><item><title>New Post: Get user list but ...</title><link>http://linqtoad.codeplex.com/discussions/272416</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is there a way to get all users from AD but with email, firstname, lastname ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;/div&gt;</description><author>Kris_I</author><pubDate>Tue, 13 Sep 2011 12:08:12 GMT</pubDate><guid isPermaLink="false">New Post: Get user list but ... 20110913120812P</guid></item><item><title>New Post: Get groups from OU</title><link>http://linqtoad.codeplex.com/discussions/272408</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is there a way to get all the Groups (not the users) available in the Organization Unit (OU) &amp;quot;Security Groups&amp;quot; ?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;/div&gt;</description><author>Kris_I</author><pubDate>Tue, 13 Sep 2011 11:22:24 GMT</pubDate><guid isPermaLink="false">New Post: Get groups from OU 20110913112224A</guid></item><item><title>New Post: The project is alive ?</title><link>http://linqtoad.codeplex.com/discussions/46618</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;jkinter,&lt;/p&gt;
&lt;p&gt;Here's the extension method I use to clean filter values:&lt;/p&gt;
&lt;p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; CleanFilterValue(&lt;span style="color: blue;"&gt;this&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; value)
{
    &lt;span style="color: blue;"&gt;var&lt;/span&gt; sb = &lt;span style="color: blue;"&gt;new&lt;/span&gt; StringBuilder();
    &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue;"&gt;var&lt;/span&gt; curChar &lt;span style="color: blue;"&gt;in&lt;/span&gt; value)
    {
        &lt;span style="color: blue;"&gt;switch&lt;/span&gt; (curChar)
        {
            &lt;span style="color: blue;"&gt;case&lt;/span&gt; '\\':
                sb.Append(&lt;span style="color: #a31515;"&gt;"\\5c"&lt;/span&gt;);
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
            &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;'*'&lt;/span&gt;:
                sb.Append(&lt;span style="color: #a31515;"&gt;"\\2a"&lt;/span&gt;);
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
            &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;'('&lt;/span&gt;:
                sb.Append(&lt;span style="color: #a31515;"&gt;"\\28"&lt;/span&gt;);
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
            &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;')'&lt;/span&gt;:
                sb.Append(&lt;span style="color: #a31515;"&gt;"\\29"&lt;/span&gt;);
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
            &lt;span style="color: blue;"&gt;case&lt;/span&gt; &lt;span style="color: #a31515;"&gt;'\u0000'&lt;/span&gt;:
                sb.Append(&lt;span style="color: #a31515;"&gt;"\\00"&lt;/span&gt;);
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
            &lt;span style="color: blue;"&gt;default&lt;/span&gt;:
                sb.Append(curChar);
                &lt;span style="color: blue;"&gt;break&lt;/span&gt;;
        }
    }
    &lt;span style="color: blue;"&gt;return&lt;/span&gt; sb.ToString();
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;You could call this on the value and pass in the result so you won't have to change your apps. &amp;nbsp;It's been a while since I've looked at the LINQ to AD source so I'm not sure where you could add this in there. &amp;nbsp;I hope this helps.&lt;/p&gt;&lt;/div&gt;</description><author>madhatter22</author><pubDate>Fri, 26 Aug 2011 03:29:48 GMT</pubDate><guid isPermaLink="false">New Post: The project is alive ? 20110826032948A</guid></item><item><title>New Post: The project is alive ?</title><link>http://linqtoad.codeplex.com/discussions/46618</link><description>&lt;div style="line-height: normal;"&gt;&lt;blockquote style="padding-bottom: 0px; font-style: italic; margin: 0.25em 1em 0px; padding-left: 0.25em; padding-right: 0.25em; padding-top: 0px; border: #ccc 0.1em solid;"&gt;&lt;strong&gt;bdesmet wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;p&gt;In fact a brand new version of LINQ to AD will appear fairly soon. I've been busy doing quite an extensive rewrite of the query translator as part of my day-to-day job. Check out &lt;a href="http://blogs.bartdesmet.net/bart"&gt;http://blogs.bartdesmet.net/bart&lt;/a&gt; for some hints as to what I'm up to nowadays. While I can't give a firm timeframe just yet, I'd encourage you to keep an eye on the website.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br /&gt;-Bart&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;br /&gt;Hi Bart,&lt;/p&gt;
&lt;p&gt;We're using&amp;nbsp; this project in several of our internal solutions and I've recently come up against the "special characters" issue and was wondering how soon is "fairly soon"? This post was quite some time ago and I'd really rather not have to assume the technical debt of pulling out your solution and replacing it with the LinqToLDAP solution. Please advise.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>jkinter</author><pubDate>Thu, 18 Aug 2011 21:29:22 GMT</pubDate><guid isPermaLink="false">New Post: The project is alive ? 20110818092922P</guid></item><item><title>New Post: Mapping to System.DirectoryServices instead of ActiveDs</title><link>http://linqtoad.codeplex.com/discussions/263568</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;The description says that it supports both but how do you map to one instead of the other? The reason I ask is because my project that is going to use this is compiled for &amp;quot;Any cpu&amp;quot; and when running on x64, I get the usual COM exception.. Compiling under
 x86 makes it work correctly but I dont want to do that..&lt;/p&gt;
&lt;/div&gt;</description><author>tgreaves</author><pubDate>Fri, 01 Jul 2011 14:43:07 GMT</pubDate><guid isPermaLink="false">New Post: Mapping to System.DirectoryServices instead of ActiveDs 20110701024307P</guid></item><item><title>New Post: DateTime issues with 4.0 Framework</title><link>http://linqtoad.codeplex.com/discussions/263325</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Just wondering if anyone has tried to upgrade this project and use it with the 4.0 framework?&lt;/p&gt;
&lt;p&gt;I am using this project to wrap my AD, and calling it using a WCF service. It works beautifully in the 4.0 framework, except it seems to have issues bringing back values that are DateTime data types. All other data types seem to work without issues.&lt;/p&gt;
&lt;p&gt;My code is simple:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim ROOT As New System.DirectoryServices.DirectoryEntry(&amp;quot;&lt;a href=""&gt;LDAP://xxxxx&lt;/a&gt;&amp;quot;, &amp;quot;xxxxx&amp;quot;, &amp;quot;xxxxx&amp;quot;)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim users As New DirectorySource(Of ADLinq.User)(ROOT, SearchScope.Subtree)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim res = From usr In users Where usr.Name.StartsWith(searchcriteria)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim dt As DataTable = HelperFunctions.GetBlankTable(GetType(ADLinq.User))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim dr As DataRow&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For Each u In res&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr = dt.NewRow()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HelperFunctions.AddRow(dr, u)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dt.Rows.Add(dr)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Next&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim ds As New DataSet()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ds.Tables.Add(dt)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Return ds&lt;/p&gt;
&lt;p&gt;The issue occurs in the class DirectorySource.cs, in the function AssignResultProperty. For a data type of DateTime (In my case PasswordLastChanged) when it attempts to get the PropertyInfo from the helper object, the variable 'p' is null, and it crashes
 on a nullreferenceexception.&lt;/p&gt;
&lt;p&gt;The line it crashes on is line 496 of DirectorySource.cs. p is null so there for it crashes.&lt;/p&gt;
&lt;p&gt;All other datatypes, it works perfectly, except for DateTime.&lt;/p&gt;
&lt;p&gt;Interestingly enough, when&amp;nbsp;I create an Identical service using the 3.5 framework, these issues do not seem to occur. Which tends to lean me towards one of the two references that have changed being the culprit. System.DirectoryServices, or System.Data,
 however I am not sure.&lt;/p&gt;
&lt;p&gt;Was just wondering if anyone has also discovered this issue, or am I totally alone on this one? And if you have figured it out, how did you do so?&lt;/p&gt;
&lt;p&gt;Thanks in Advance,&lt;/p&gt;
&lt;p&gt;Jason Schatz&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>azeltroth</author><pubDate>Wed, 29 Jun 2011 22:25:44 GMT</pubDate><guid isPermaLink="false">New Post: DateTime issues with 4.0 Framework 20110629102544P</guid></item><item><title>New Post: The project is alive ?</title><link>http://linqtoad.codeplex.com/discussions/46618</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Jetski5822,&lt;/p&gt;
&lt;p&gt;You're welcome to use&amp;nbsp;&lt;a title="http://linqtoldap.codeplex.com/" href="http://linqtoldap.codeplex.com/" target="_blank"&gt;&lt;a href="http://linqtoldap.codeplex.com/"&gt;http://linqtoldap.codeplex.com/&lt;/a&gt;&lt;/a&gt;. However, I use System.DirectoryServices.Protocols to get broader LDAP server support so if you're use to just System.DirectoryServices there's a slight learning curve (if you  want to dig into the internals). &amp;nbsp;If LINQ to AD gets updated I'll delete this post, but right now like this project looks dead.&lt;/p&gt;&lt;/div&gt;</description><author>madhatter22</author><pubDate>Sat, 14 May 2011 16:44:02 GMT</pubDate><guid isPermaLink="false">New Post: The project is alive ? 20110514044402P</guid></item><item><title>New Post: The project is alive ?</title><link>http://linqtoad.codeplex.com/discussions/46618</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Im going to implement it in &lt;a href="http://orchardopenauth.codeplex.com/"&gt;http://orchardopenauth.codeplex.com/&lt;/a&gt; Could you tell us when your going to release a new version?&lt;/p&gt;&lt;/div&gt;</description><author>Jetski5822</author><pubDate>Thu, 24 Feb 2011 21:24:18 GMT</pubDate><guid isPermaLink="false">New Post: The project is alive ? 20110224092418P</guid></item><item><title>Reviewed: LINQ to Active Directory RTW (Jan 25, 2011)</title><link>http://linqtoad.codeplex.com/releases/view/8629#ReviewBy-omarqa</link><description>Rated 4 Stars &amp;#40;out of 5&amp;#41; - wonderful work&amp;#33; needed better documentation.</description><author>omarqa</author><pubDate>Tue, 25 Jan 2011 11:40:08 GMT</pubDate><guid isPermaLink="false">Reviewed: LINQ to Active Directory RTW (Jan 25, 2011) 20110125114008A</guid></item><item><title>New Post: The project is alive ?</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=46618</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Any news, Bart?&lt;/p&gt;
&lt;/div&gt;</description><author>MadHatter22</author><pubDate>Mon, 10 Jan 2011 05:32:27 GMT</pubDate><guid isPermaLink="false">New Post: The project is alive ? 20110110053227A</guid></item><item><title>Commented Issue: Really Big Problem:  Doesn't Filter Distinguished Name properly.  Doesn't Handle Escape Characters Correctly Upon WHERE Comparison [3693]</title><link>http://linqtoad.codeplex.com/workitem/3693</link><description>Tell me I am not the only one to run into this...&lt;br /&gt;&lt;br /&gt;The Distinguished Name of an object in the Active Directoy requires that certain characters are escaped.  Please refer to http&amp;#58;&amp;#47;&amp;#47;www.rlmueller.net&amp;#47;CharactersEscaped.htm.&lt;br /&gt;&lt;br /&gt;I have an Active Directory group named &amp;#34;MyActiveDirectoryGroupName&amp;#34; which contains objects that have the following Distinguished Name&amp;#39;s&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#34;CN&amp;#61;John Doe,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&amp;#34;CN&amp;#61;Jane Doe,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&amp;#34;CN&amp;#61;Krugar, Freddy,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&lt;br /&gt;Notice the , in the &amp;#34;CN&amp;#61;&amp;#34;.  As far as Active Directory is concerned this translates to&amp;#58;&lt;br /&gt;&amp;#34;CN&amp;#61;Krugar&amp;#92;, Freddy,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34; because the  , has to be escaped using a &amp;#92; in front of it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But guess what...when I run the following query&amp;#58;&lt;br /&gt;&lt;br /&gt;------------------------------------&lt;br /&gt;        DirectoryEntry ROOT &amp;#61; new DirectoryEntry&amp;#40;ConfigurationSettings.AppSettings&amp;#91;&amp;#34;ActiveDirectory&amp;#34;&amp;#93;&amp;#41;&amp;#59;&lt;br /&gt;        MyCompanyName.LINQ.ActiveDirectory.ADsContext ctx &amp;#61; new MyCompanyName.LINQ.ActiveDirectory.ADsContext&amp;#40;ROOT&amp;#41;&amp;#59;&lt;br /&gt;&lt;br /&gt;        var results &amp;#61; from item in ctx.Groups&lt;br /&gt;                      where item.Name &amp;#61;&amp;#61; &amp;#34;MyActiveDirectoryGroupName&amp;#34;         &amp;#47;&amp;#47; Note&amp;#58; Name is the &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;name&amp;#34;&amp;#41;&amp;#93; for the Group object.&lt;br /&gt;                      select item&amp;#59;&lt;br /&gt;&lt;br /&gt;        foreach &amp;#40;var item in results&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            rptrGroupMember.DataSource &amp;#61; item.Members&amp;#59;&lt;br /&gt;            rptrGroupMember.DataBind&amp;#40;&amp;#41;&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;---------------------------------&lt;br /&gt;Above Members is a string&amp;#91;&amp;#93; array of the Distinguished Name&amp;#39;s of the members in the group I just query&amp;#39;d. LOL&amp;#33;  Yay this is what I want....oh but wait...&lt;br /&gt;&lt;br /&gt;Now I need to take the value in the Members&amp;#91;x&amp;#93; &amp;#40;which is the string Distinguished Name&amp;#41; and go lookup the User information since the Distinguished Name is the unique value I should be using to lookup a user fromt he Active Directory right, or any other object for that matter&amp;#63; ....ok lets do that...&lt;br /&gt;&lt;br /&gt;So I created the following additional query&amp;#58;&lt;br /&gt;&lt;br /&gt;------------------------------------&lt;br /&gt;public string GetGroupMemberSAMAccountName&amp;#40;object data&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt;        DirectoryEntry ROOT &amp;#61; new DirectoryEntry&amp;#40;ConfigurationSettings.AppSettings&amp;#91;&amp;#34;ActiveDirectory&amp;#34;&amp;#93;&amp;#41;&amp;#59;&lt;br /&gt;        MyCompanyName.LINQ.ActiveDirectory.ADsContext ctx &amp;#61; new MyCompanyName.LINQ.ActiveDirectory.ADsContext&amp;#40;ROOT&amp;#41;&amp;#59;&lt;br /&gt;        &lt;br /&gt;        var results &amp;#61; from item in ctx.Users&lt;br /&gt;                      where item.Dn &amp;#61;&amp;#61; Convert.ToString&amp;#40;data&amp;#41;           &amp;#47;&amp;#47; Note&amp;#58; Dn is the &amp;#91;DirectoryAttribute&amp;#40;&amp;#34;distinguishedName&amp;#34;&amp;#41;&amp;#93; for the User object.&lt;br /&gt;                      select item&amp;#59;&lt;br /&gt;&lt;br /&gt;        string itemValue&amp;#61; string.Empty&amp;#59;&lt;br /&gt;&lt;br /&gt;        foreach &amp;#40;var item in results&amp;#41;&lt;br /&gt;        &amp;#123;&lt;br /&gt;            itemValue&amp;#61; item.SAMAccountName&amp;#59;&lt;br /&gt;        &amp;#125;&lt;br /&gt;&lt;br /&gt;        return itemValue&amp;#59;&lt;br /&gt;&amp;#125;&lt;br /&gt;--------------------------------&lt;br /&gt;Ya this should work&amp;#33;  And guess what it does except for one thing which is a deal breaker.  The only result&amp;#40;s&amp;#41; I get back is the John Doe and the Jane Doe.  What&amp;#63;  Why&amp;#63;  Well after spending a lot of time trying to pin point it, a pattern started to emerge...crap...the Distinguished Name&amp;#39;s that have Last Name first and First Name last doesn&amp;#39;t match correctly when the LINQ builds the query to use against the LDAP search for the Active Directory.  I thought, well maybe I am passing the value wrong to it.  If you look at the Convert.ToString&amp;#40;data&amp;#41; value during debugging you see the following&amp;#58;&lt;br /&gt;&lt;br /&gt;&amp;#34;CN&amp;#61;Krugar&amp;#92;&amp;#92;, Freddy,OU&amp;#61;Location A,OU&amp;#61;Company Objects,DC&amp;#61;mycompany,DC&amp;#61;com&amp;#34;&lt;br /&gt;&lt;br /&gt;Hmmm...wonder what I have to do in order to get this LINQtoAD component to realize that this should match.  When I looked further into the debuggin I noticed that the &amp;#92; gets translated later on int he LINQtoAD project as the 0x5c value which of course is the ANSII value for &amp;#92;.  Don&amp;#39;t know if that has anything to do with it.  Anyone have any ideas or resolutions&amp;#63;  I can&amp;#39;t seriously be the only one who has run into this.  And this is the only LINQtoAD component out there that I am aware of.  Couldn&amp;#39;t we make it work a little better by having the component realize that matching on Distinguished Name is crutial since Active Directory uses this as the object fully qualified name&amp;#63;  It kinda like I want to search on a unique ID of a object but LINQtoAD won&amp;#39;t let me.  Bummer...  Any ideas&amp;#63;&lt;br /&gt;Comments: ** Comment from web user: mingsai ** &lt;p&gt;I believe the search operations work bi-directionally and this may be why you are seeing inconsistent results. See the following for additional information. http&amp;#58;&amp;#47;&amp;#47;www.ldapexplorer.com&amp;#47;en&amp;#47;manual&amp;#47;109010000-ldap-filter-syntax.htm&lt;/p&gt;</description><author>mingsai</author><pubDate>Thu, 23 Dec 2010 18:21:42 GMT</pubDate><guid isPermaLink="false">Commented Issue: Really Big Problem:  Doesn't Filter Distinguished Name properly.  Doesn't Handle Escape Characters Correctly Upon WHERE Comparison [3693] 20101223062142P</guid></item><item><title>New Post: The project is alive ?</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=46618</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Which calendar year is &amp;quot;quite soon&amp;quot; in?&lt;/p&gt;
&lt;/div&gt;</description><author>jerrynixon</author><pubDate>Mon, 08 Nov 2010 21:47:40 GMT</pubDate><guid isPermaLink="false">New Post: The project is alive ? 20101108094740P</guid></item></channel></rss>