<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>LINQtoAD Forum Rss Feed</title><link>http://www.codeplex.com/LINQtoAD/Thread/List.aspx</link><description>LINQtoAD Forum Rss Description</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>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>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>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><item><title>New Post: Finding the last logon date time</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=204169</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;With the obvious caveat that this only gets you the last logon date against whichever domain controller your query was executed.&lt;/p&gt;
&lt;p&gt;Ref, e.g., &lt;a href="http://blogs.dirteam.com/blogs/jorge/archive/2008/02/10/showing-last-logon-info-at-logon-in-windows-server-2008.aspx"&gt;
http://blogs.dirteam.com/blogs/jorge/archive/2008/02/10/showing-last-logon-info-at-logon-in-windows-server-2008.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>PerrySharePoint</author><pubDate>Thu, 04 Nov 2010 04:21:33 GMT</pubDate><guid isPermaLink="false">New Post: Finding the last logon date time 20101104042133A</guid></item><item><title>New Post: Getting user attributes dynamically</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=232898</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I see that the user entity is built using a predefined set of attributes to return. &amp;nbsp;Is there a way to dynamically get attributes at runtime based on selected attributes?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;/div&gt;</description><author>wrecklesswun</author><pubDate>Sat, 30 Oct 2010 14:59:25 GMT</pubDate><guid isPermaLink="false">New Post: Getting user attributes dynamically 20101030025925P</guid></item><item><title>New Post: VS2010</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=205507</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi Bart,&lt;/p&gt;
&lt;p&gt;Do you know when the VS2010/.Net 4 targeted version of Linq to AD will be released?&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;/div&gt;</description><author>CreepyGnome</author><pubDate>Sat, 30 Oct 2010 01:55:05 GMT</pubDate><guid isPermaLink="false">New Post: VS2010 20101030015505A</guid></item><item><title>New Post: How to get a list of contacts?</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=230835</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I am a total newbie to programming, Visual Basic, Visual Studio, and LINQ.&amp;nbsp; I am trying to build a very simple web application to manage *contact* items&amp;nbsp;at any given OU in Active Directory.&amp;nbsp; I would like to use&amp;nbsp;LINQ to Active Directory to allow me to get the list of contacts, as well as create new contacts, and updated and delete existing contacts.&amp;nbsp; I have been doing a *lot* of reading for the past two weeks trying to get this to work, but I have not yet been able to accomplish what I need to do.&amp;nbsp; It would be great if someone would be so kind to explain&amp;nbsp;how to use LINQ to AD in Visual Studio 2010 so that I can do what I have described above step-by-step.&amp;nbsp; Alternatively, if you think I should be trying something totally different, please be so kind and point me in the corrent direction.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you all very much for any help you might be able to provide.&lt;/p&gt;&lt;/div&gt;</description><author>jorgevazquez</author><pubDate>Thu, 14 Oct 2010 01:13:39 GMT</pubDate><guid isPermaLink="false">New Post: How to get a list of contacts? 20101014011339A</guid></item><item><title>New Post: Finding the last logon date time</title><link>http://linqtoad.codeplex.com/Thread/View.aspx?ThreadId=204169</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thanks. Very helpful.&lt;/p&gt;&lt;/div&gt;</description><author>adeelsansari</author><pubDate>Sat, 09 Oct 2010 05:12:46 GMT</pubDate><guid isPermaLink="false">New Post: Finding the last logon date time 20101009051246A</guid></item></channel></rss>