Active Directory and LDAPhttp://forums.asp.net/93.aspx/1?Active+Directory+and+LDAPQuestions about Active Directory and other directory stores, such as those accessible via LDAPThu, 13 Jun 2013 09:44:11 -0400urn:uuid:00000000-0000-0000-0000-000000000093urn:uuid:00000000-0000-0000-0000-000005114127http://forums.asp.net/p/1835524/5114127.aspx/1?DirectoryServicesCOMException+DirectoryServicesCOMException <p>Hello all, I have a web app that looks up a users email in AD and returns the email so the app can send a confirmation email. The lookup has been working fine for two weeks, but recently has started throwing an exception.&nbsp;</p> <pre>System.DirectoryServices.DirectoryServicesCOMException</pre> <pre class="stacktrace"><span class="exceptionTypeHeading">[System.DirectoryServices.DirectoryServicesCOMException]</span> Inner Exception at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindOne() at JobDB.pullestimatenum.JobInsertedSql(Object sender, SqlDataSourceStatusEventArgs e) in <a href="file:///C:/JobDB/JobDB/pullestimatenum.aspx.cs">C:\JobDB\JobDB\pullestimatenum.aspx.cs</a>:line 106 at System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) at System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) at System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) at System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</pre> <pre class="stacktrace"></pre> <pre class="stacktrace">This is the code I am using to get the email:</pre> <pre class="prettyprint">//Send user email DirectorySearcher searcher = new DirectorySearcher(); searcher.Filter = string.Format(&quot;sAMAccountName={0}&quot;, User.Identity.Name.Substring(Request.LogonUserIdentity.Name.LastIndexOf(@&quot;\&quot;) &#43; 1)); SearchResult user = searcher.FindOne(); string emailAddr = user.Properties[&quot;mail&quot;][0].ToString() ?? &quot;&quot;;</pre> <p>Does anyone see anything wrong with this code? I cannot figure out why this would have started all of a sudden?</p> <p>Edit: I tried restarting the website, recycling the application pool, and republishing the website and it is still not working. It is fine when I debug it from my dev machine.</p> <p>Thanks,<br> Brennan&nbsp;</p> 2012-08-20T17:34:37-04:002012-08-20T17:34:37.63-04:00urn:uuid:00000000-0000-0000-0000-000005419665http://forums.asp.net/p/1912916/5419665.aspx/1?Windows+AuthenticationWindows Authentication <p>Hi ,</p> <p>&nbsp;How to add multiple users dynamically for windows authentication not by using web.config. If we have 1000 users&nbsp; mentioning&nbsp; in web.config is not good. Is there any alternate for providing access to 1000 users. Pls help me.</p> <p></p> 2013-06-10T13:15:55-04:002013-06-10T13:15:55.177-04:00urn:uuid:00000000-0000-0000-0000-000005423476http://forums.asp.net/p/1913785/5423476.aspx/1?What+steps+do+we+take+to+move+from+AD+to+local+users+authentication+What steps do we take to move from AD to local users authentication? <p>We've got an ASP.NET Web Forms app we started 10 years ago, probably using VS 2003 at the time. Back then we used Active Directory to authenitcate our users. That website is now at VS 2008, .NET 3.5, but it still uses AD to authenticate our users.</p> <p>Now we're going through a migration. Our servers are being taken over by a larger organization, and they've proposed changing from AD for authentication to using local users on the new server (a virtual machine running on their systems). This seems to satisfy a lot of things, in that the authentication calls should (I imagine) stay pretty much the same as they have been, and the organization that's going to be taking over administering servers on our behalf, don't have to create lots of new accounts in the AD network. But my question is, what steps do I need to do, as the administrator and developer of this ASP.NET website, to make it no longer authenticate with AD, but instead use local users on the VM server?</p> 2013-06-13T13:42:35-04:002013-06-13T13:42:35.68-04:00urn:uuid:00000000-0000-0000-0000-000005414028http://forums.asp.net/p/1911572/5414028.aspx/1?Unlock+account+using+security+Q+A+using+AD+net+membership+provider+Unlock account using security Q&A using AD .net membership provider? <p>I have a .net web app that uses AD to manager the users, I got the security question and answer working to reset the password (followed this article:&nbsp;<a href="http://msdn.microsoft.com/en-us/library/ms998360.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms998360.aspx</a>)</p> <p>The problem: Currently AD's&nbsp;<span style="font-family:Consolas,monospace">Lockout-Threshold</span>&nbsp;is set to&nbsp;<span style="font-family:Consolas,monospace">0</span>&nbsp;so the user can try to login as many times they want. If I set the&nbsp;<span style="font-family:Consolas,monospace">Lockout-Threshold</span>&nbsp;to&nbsp;<span style="font-family:Consolas,monospace">5</span>&nbsp;attempts and the account is locked then the security question and answer don't work, cannot reset the password if AD locks the account.</p> <p>Is there way to lock the account after 5 attempts but allow the user to go though the password Q&amp;A process?</p> <p>Thanks,</p> <p>Tarek</p> <p></p> 2013-06-04T13:29:27-04:002013-06-04T13:29:27.69-04:00urn:uuid:00000000-0000-0000-0000-000005418221http://forums.asp.net/p/1912535/5418221.aspx/1?AzMan+ComExceptionAzMan ComException <p>Hi there,</p> <p>We have used Az Role Manager for 4 years, and it never had had problems.</p> <p>But, during the last seven days, it&nbsp;has been giving us some problems, and its errors says:</p> <p>-2147024838<br> The specified server cannot perform the requested operation. (Exception from HRESULT: 0x8007003A)<br> Interop.AZROLESLib<br> at AZROLESLib.AzAuthorizationStoreClass.Initialize(Int32 lFlags, String bstrPolicyURL, Object varReserved)<br> at TEF.CustomADAM.IsUserOp(enuOperaciones Operacion)<br> System.Runtime.InteropServices.COMException (0x8007003A): The specified server cannot perform the requested operation. (Exception from HRESULT: 0x8007003A)<br> at AZROLESLib.AzAuthorizationStoreClass.Initialize(Int32 lFlags, String bstrPolicyURL, Object varReserved)<br> at TEF.CustomADAM.IsUserOp(enuOperaciones Operacion)</p> <p>But only happens sometimes in an hour,</p> <p><br> We have a Intance Adam installation on an Windows 2003 server, and the web site in an IIS 7.0</p> <p>Does anyone have been through the same error?</p> 2013-06-07T23:39:18-04:002013-06-07T23:39:18.917-04:00urn:uuid:00000000-0000-0000-0000-000005213964http://forums.asp.net/p/1859613/5213964.aspx/1?Property+value+returned+by+DirectorySearcher+and+SearchResponse+are+of+different+type+System+_comobject+and+Byte+arrayProperty value returned by DirectorySearcher and SearchResponse are of different type System._comobject and Byte array <p><span>Hi,</span><br> <span>I am working on a website to manage active directory. I want to check that whether user has permission to change password or not.</span><br> <span>So I have to find &quot;ntSecurityDescriptor&quot; property value after that I have to cast it into IADsSecurityDescriptor.</span><br> <span>Now if I use DirectorySearcher class then property value is of type System._ComObject and easily casted to IADsSecurityDescriptor.</span><br> <span>But when I use LdapConnection and SearchResponse I get property value of type byte[] array which is unale to cast to IADsSecityDescriptor. I am getting error&nbsp;</span><br> <span>&quot;Unable to cast System.Byte[] to IADsSecurityDescriptor&quot;.</span><br> <span>&nbsp;</span><br> <span>Is there some problem with SearchResponse or I have use some kind of casting technique to achieve this.&nbsp;</span><br> <span>I have some problem to use DirectoryEntry class so I can only use LdapConnction class.</span><br> <span>&nbsp;</span><br> <span>Please help its urgent.</span><br> <span>Thanks.</span></p> 2012-11-19T05:57:34-05:002012-11-19T05:57:34.223-05:00urn:uuid:00000000-0000-0000-0000-000005409197http://forums.asp.net/p/1910458/5409197.aspx/1?LDAP+over+SSLLDAP over SSL <p>Hi,</p> <p>I am using following code to create&nbsp; a user in active directory and set the password. It work fine using port 389 (without SSL).</p> <p>String connectionPrefix = “LDAP://PC576-1.ADLAB.com:389/CN=Users,DC=ADLAB,DC=com”;<br> DirectoryEntry m_dirEntry = new DirectoryEntry(connectionPrefix);<br> using (m_newUserDirEntry = m_dirEntry.Children.Add(“testuser”, “user”))<br> {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.Properties[&quot;sAMAccountName&quot;].Value = m_userName;<br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.CommitChanges();<br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.Invoke(&quot;SetPassword&quot;, new object[] { &quot;password&quot; });<br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.CommitChanges();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> }</p> <p>I need to change my application to use only LDAP over SSL. So I have changed my code to use 636 port and set the Authentication Type = “AuthenticationTypes.SecureSocketsLayer”. But it is throwing the “An operations error occurred.”</p> <p>String connectionPrefix = “LDAP://PC576-1.ADLAB.com:636/CN=Users,DC=ADLAB,DC=com”;<br> DirectoryEntry m_dirEntry = new DirectoryEntry(connectionPrefix);<br> m_dirEntry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer;<br> using (m_newUserDirEntry = m_dirEntry.Children.Add(“testuser”, “user”))<br> {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.Properties[&quot;sAMAccountName&quot;].Value = m_userName;<br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.CommitChanges();<br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.Invoke(&quot;SetPassword&quot;, new object[] { &quot;password&quot; });<br> &nbsp;&nbsp;&nbsp; m_newUserDirEntry.CommitChanges();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> }</p> <p>I understand the SSL Certificate needs to be configured to use LDAP over SSL. I have gone through various websites like one below.&nbsp;</p> <p><a href="http://www.informit.com/articles/article.aspx?p=474649&amp;seqNum=4">http://www.informit.com/articles/article.aspx?p=474649&amp;seqNum=4</a></p> <p>It suggested to use “System.DirectoryServices.Protocols” to change the password using LDAP over SSL using the SSL certificate generated from AD DS domain controller.&nbsp; My query is I want to make all the transaction through LDAP over SSL (not just for password reset). Is it possible? If that is the case where I need to configure SSL certificate.</p> <p>Regards,<br> Yunus</p> 2013-05-30T07:25:17-04:002013-05-30T07:25:17.493-04:00urn:uuid:00000000-0000-0000-0000-000005408314http://forums.asp.net/p/1910250/5408314.aspx/1?LDAP+description+raise+err+Cannot+get+the+data+of+the+row+from+the+OLE+DB+provider+ADSDSOObject+for+linked+server+ADSI+Could+not+convert+the+data+value+due+to+reasons+other+than+sign+mismatch+or+overflowLDAP description raise err Cannot get the data of the row from the OLE DB provider "ADSDSOObject" for linked server "ADSI". Could not convert the data value due to reasons other than sign mismatch or overflow <p>Hi All,</p> <p>&nbsp;</p> <p>i try to run:-</p> <p></p> <p><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">SELECT</span></span><span size="2" style="font-size:small">&nbsp; sAMAccountName</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">=</span></span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">'av\'</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">&#43;</span></span><span size="2" style="font-size:small">sAMAccountName</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">description</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small">department</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small">givenName</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small"> LE </span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">=</span></span><span size="2" style="font-size:small"> </span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">'ASG'</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small"> sn</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small">mail</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small"> manager</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">=</span></span><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small"><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small">Replace</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">(</span></span><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small"><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small">Replace</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">(</span></span><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small"><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small">SUBSTRING</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">(</span></span><span size="2" style="font-size:small">manager</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small">1</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small"><span size="2" color="#ff00ff" style="color:#ff00ff; font-size:small">CHARINDEX</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">(</span></span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">','</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small">manager</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small">0</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">)-</span></span><span size="2" style="font-size:small">1</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">),</span></span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">'CN='</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">''</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">),</span></span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">' '</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">'.'</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">),</span></span><span size="2" style="font-size:small"> userPrincipalName&nbsp; </span></p> <p><br> <span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">FROM</span></span><span size="2" style="font-size:small"> </span><span size="2" color="#0000ff" style="color:#0000ff; font-size:small"><span size="2" color="#0000ff" style="color:#0000ff; font-size:small">OpenQuery</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">(</span></span><span size="2" style="font-size:small">ADSI</span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">,</span></span><span size="2" style="font-size:small"> </span><span size="2" color="#ff0000" style="color:#ff0000; font-size:small"><span size="2" color="#ff0000" style="color:#ff0000; font-size:small">'&lt;LDAP://av.com/OU=Users,OU=Singapore,OU=.AP,DC=av,DC=com&gt;;(&amp;(objectClass=User)(&amp;(objectCategory=Person)));sAMAccountName,description,department,givenName, sn, mail, manager, userPrincipalName'</span></span><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">)</span></span></p> <p><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small">i got error:-</span></span></p> <p><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="1" style="font-size:xx-small"><span size="1" style="font-size:xx-small"></span></span></span></span></p> <p>Msg 7346, Level 16, State 2, Line 1</p> <p><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="1" style="font-size:xx-small"><span size="1" style="font-size:xx-small"></span></span></span></span></p> <p>Cannot get the data of the row from the OLE DB provider &quot;ADSDSOObject&quot; for linked server &quot;ADSI&quot;. Could not convert the data value due to reasons other than sign mismatch or overflow.</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>If i remove description from the sql, it work fine.</p> <p>&nbsp;</p> <p>Please advise.</p> <p>&nbsp;</p> <p>Regards,</p> <p>Micheale</p> <p><span size="2" color="#808080" style="color:#808080; font-size:small"><span size="2" color="#808080" style="color:#808080; font-size:small"></span></span></p> 2013-05-29T13:01:15-04:002013-05-29T13:01:15.087-04:00urn:uuid:00000000-0000-0000-0000-000005404693http://forums.asp.net/p/1909414/5404693.aspx/1?Active+Directory+groupsActive Directory groups <p>I am trying to get a list of security groups in AD but I am not having much luck. When I check Active Directory Users and Computers MMC, I see:</p> <p>blah.blah.com (top)</p> <p>Group1</p> <p>&nbsp;&nbsp;&nbsp; Group1_1</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Group1_1_1</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Group1_1_2</p> <p>&nbsp;&nbsp;&nbsp; Group1_2</p> <p>Group2</p> <p>and so on. What I need is all security groups in Group1_1_2. I tried using DirectoryEntry and DirectorySearcher using &quot;(&amp;(objectClass=group))&quot; as search filter but I get things I can't even find in Active Directory Users and Computers MMC.</p> <p>Thanks.</p> 2013-05-24T17:53:01-04:002013-05-24T17:53:01.913-04:00urn:uuid:00000000-0000-0000-0000-000005382696http://forums.asp.net/p/1903392/5382696.aspx/1?Login+page+using+MVC+4+using+ldap+should+populate+domains+dropdownlistLogin page using MVC 4 using ldap should populate domains' dropdownlist &lt;div&gt;Hey Hi<br> <br> Authentication seems worked in my test environment. Changed web.config <br> <br> Now I'm writing a web-app that is required to present users with a login screen.&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;Users can enter username/password and select a domain from a dropdown list.&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;how to enumerate all available domains in the server's AD forest even before user login after basic authentication?&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;My doubt is ... even with out login and validating user to AD, how could dropdown box canbe populated with list of available domains so taht while login user can select respective domain?&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;will it populate domains list from sqlserver database or can pull up from AD itself?&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;Please guide me...<br> <br> &lt;/div&gt; 2013-05-02T21:50:54-04:002013-05-02T21:50:54.2-04:00urn:uuid:00000000-0000-0000-0000-000005208746http://forums.asp.net/p/1858282/5208746.aspx/1?Configuration+Error+Please+Help+Configuration Error - Please Help! <p>Dear Guys,</p> <p>I'm really having like a nightmare in solving this error. I don't understand it totally. I have a small program which i created in my pc and has active directory authentication. It's perfectly working in my pc and i don't have any problem at all. SQL connectivity is perfectly configured too because i tried to&nbsp;run my web application&nbsp;from my PC using my server SQL address connectivity, it works fine. When I copy all of my files under wwwroot/comms to the server (wwwroot/comms, it gives me this error. Please check it below. I don't know how to resolve this. I hope you guys could shed your brilliant solution in my situation.</p> <p>PC Specs: Windows 7, MS VS 2010 and SQL Server 2008.</p> <p>Server Specs: WinSvr2008 R2, SQL Server 2012.</p> <p><span><span>&nbsp;Thanks a lot in advance. Jim. </span></span></p> <h1>Server Error in '/comms' Application.</h1> <hr color="silver" size="1" width="100%"> <h2><i>Configuration Error</i></h2> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><b>Description: </b>An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. <br> <br> <b>Parser Error Message: </b>An operations error occurred.<br> <br> <br> <b>Source Error:</b> <br> <br> </span></span></p> <table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td> <pre>Line 35: maxInvalidPasswordAttempts=&quot;5&quot; minRequiredPasswordLength=&quot;6&quot; minRequiredNonalphanumericCharacters=&quot;0&quot; passwordAttemptWindow=&quot;10&quot; Line 36: applicationName=&quot;/&quot;/&gt;--&gt; <span color="red" style="color:#ff0000">Line 37: &lt;add name=&quot;AspNetActiveDirectoryMembershipProvider&quot; type=&quot;System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; connectionStringName=&quot;ADService&quot; attributeMapUsername=&quot;sAMAccountName&quot;/&gt; </span></pre> <pre><span color="red" style="color:#ff0000"></span>Line 38: &lt;/providers&gt; Line 39: &lt;/membership&gt;</pre> </td> </tr> </tbody> </table> 2012-11-13T08:41:18-05:002012-11-13T08:41:18.423-05:00urn:uuid:00000000-0000-0000-0000-000005394355http://forums.asp.net/p/1906122/5394355.aspx/1?How+to+reset+the+extensionAttributes+to+defaultHow to reset the extensionAttributes to default <p>Hello Everyone,</p> <p>I am trying to reset the values for the extensionAttributes for the active directory users.</p> <p>I was using couple of extensionAttributes to the save some information for the users, but at some point we just want to reset those extensionAttributes to default values for now i am trying to update the AD with &quot;&quot; value for the extension attributes but it makes the user unstable.</p> <p>Could anyone tell me what should be the default value i must pass to the extensionAttributes before calling the SaveChanges for the active directory. Any kind of help will be appriciated.</p> <p>Thanks in advance</p> <p>Ram</p> 2013-05-15T07:21:26-04:002013-05-15T07:21:26.85-04:00urn:uuid:00000000-0000-0000-0000-000005357430http://forums.asp.net/p/1896743/5357430.aspx/1?does+anybody+know+how+to+write+the+filter+criteria+on+organizational+unit+ou+in+ldap+filter+does anybody know how to write the filter criteria on organizational unit(ou) in ldap filter? <p>Hi All,</p> <p>does anybody know how to write the filter criteria on organizational unit(ou) in ldap filter?</p> <p>thanks,</p> 2013-04-09T11:43:20-04:002013-04-09T11:43:20.833-04:00urn:uuid:00000000-0000-0000-0000-000005060629http://forums.asp.net/p/1822698/5060629.aspx/1?Users+Info+from+Active+Directory+VS2010Users' Info from Active Directory - VS2010 <p>The following code return all user name...</p> <p>How do I get their 'Department' and the &quot;Manager' names?</p> <pre class="prettyprint">string groupName = &quot;Domain Users&quot;; string domainName = &quot;us.MySite.com&quot;; listBox1.Items.Clear(); PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domainName); GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx, IdentityType.SamAccountName, groupName); if (grp != null) { foreach (Principal p in grp.GetMembers(false)) { string sLoginName = p.SamAccountName; if (!string.IsNullOrEmpty(sLoginName)) if (System.Text.RegularExpressions.Regex.IsMatch(sLoginName, @&quot;^[a-zA-Z]&#43;$&quot;)) if (!string.IsNullOrEmpty(p.DisplayName)) { listBox1.Items.Add(p.DisplayName); listBox2.Items.Add(p.SamAccountName &#43; &quot; - &quot; &#43; p.DisplayName &#43; &quot; - &quot; &#43; p.UserPrincipalName); } } grp.Dispose(); ctx.Dispose(); Console.ReadLine(); } else { Console.WriteLine(&quot;\nWe did not find that group in that domain, perhaps the group resides in a different domain?&quot;); Console.ReadLine();</pre> <p></p> 2012-07-10T19:40:13-04:002012-07-10T19:40:13.94-04:00urn:uuid:00000000-0000-0000-0000-000005383926http://forums.asp.net/p/1903680/5383926.aspx/1?how+to+find+out+a+particular+user+s+user+name+and+email+by+adhow to find out a particular user's user name and email by ad <p>Hi,</p> <p>Does anyone has nay idea how to find out user name and email address by user ad?Because wheever an account is created, i need to find out if the user really exist in ad and hence retrive his user name and email address?</p> <p>Does anyone has idea on this?</p> <p>Help Please!!</p> 2013-05-04T05:38:40-04:002013-05-04T05:38:40.387-04:00urn:uuid:00000000-0000-0000-0000-000005380346http://forums.asp.net/p/1902862/5380346.aspx/1?The+In+Famous+Access+Denied+problemThe (In)Famous "Access Denied" problem <p>I've been through literally dozens of articles and forum entries, and yet this problem hangs on. I am writing a simple ASP.NET UserControl &nbsp;to allow our users to update their basic profile information, and change their password. The UserControl can read anything from Active Directory. Changes will not save. &quot;Access is denied.&quot;</p> <ul> <li>Credentials are good. We have a Service Account that is correctly delegated to update user profiles and passwords. </li><li>I have also tried using my own credentials. I am a Domain Admin. </li><li>I have tested without credentials. It won't even read without credentials, so the credentials ARE working. </li><li>I have turned Windows Authentication on and off in IIS 7. </li><li>I have turned Impersonation on and off in IIS 7. </li><li>I have used Impersonation in code. </li><li>I have run IIS7's process under accounts with &quot;god&quot; rights. </li><li>I have used the &quot;old&quot; DirectoryServices.DirectoryEntry approach, and the &quot;new&quot; AcccountManagement.PrincipalContext approach. </li><li>I have run the code on my home machine through a VPN connection. </li><li>I have run the code on my office development machine on the domain. </li><li>I have run the code on the Intranet web server, which is on the domain. </li><li>In all three environments, I can run &quot;ADSI Edit&quot; or &quot;Active Directory Users and Computers,&quot; and change anything for any object. So the credentials and network are good. </li><li>I remembered that &quot;way back when&quot; there was a bug somewhere, that C# code would not work, but VB.NET code would. I figured that little bug was long gone, but thought I'd try anyway. So I re-wrote the UserControl in VB.NET. No joy. </li></ul> <p>When the code runs-- no matter what-- the result is the same. &quot;Access is denied.&quot;</p> <p>I wrote a similar ASP.NET UserControl &quot;way back when&quot; in 2001, for use on a Win2000 domain with multiple forests. It was simple to do and worked like a charm. This present environment is a &quot;single forest&quot; Win2008-R2 domain. Security is tougher, sure. But the .NET code is new and more robust. So what gives?</p> <p>Here is my present block of code. (Error occurs at line &quot;up.Save();.&quot;</p> <pre><span>protected</span>&nbsp;<span>void</span>&nbsp;btnSave_Click(<span>object</span>&nbsp;sender,&nbsp;<span>EventArgs</span>&nbsp;e) { // Get logged-in user's info to be updated. SearchAD(); // Load the control's User object from web form.<br> User.Location&nbsp;=&nbsp;lblLocation.Text; User.DisplayName&nbsp;=&nbsp;txtDisplayName.Text; User.Email&nbsp;=&nbsp;txtEmail.Text; User.FirstName&nbsp;=&nbsp;txtFirstName.Text; User.HomePhone&nbsp;=&nbsp;txtHomePhone.Text; User.LastName&nbsp;=&nbsp;txtLastName.Text; User.MobilePhone&nbsp;=&nbsp;txtMobilePhone.Text; User.WorkPhone&nbsp;=&nbsp;txtWorkPhone.Text; <br> // Open an AD PrincipalContext and UserPrincipal object. <span>PrincipalContext</span>&nbsp;context&nbsp;=&nbsp;<span>new</span>&nbsp;<span>PrincipalContext</span>(<span>ContextType</span>.Domain,&nbsp;<span>@&quot;server.domainname.local&quot;</span>,&nbsp;<span>@&quot;domain\delegate&quot;</span>,&nbsp;<span>@&quot;password&quot;</span>); <span>UserPrincipal</span>&nbsp;up&nbsp;=&nbsp;<span>UserPrincipal</span>.FindByIdentity(context,&nbsp;User.LoginName); <br> // Assign values to the Active Directory user<br> // AccountManager properties up.DisplayName&nbsp;=&nbsp;NullString(User.DisplayName); up.EmailAddress&nbsp;=&nbsp;NullString(User.Email); up.GivenName&nbsp;=&nbsp;NullString(User.FirstName); up.Surname&nbsp;=&nbsp;NullString(User.LastName); up.VoiceTelephoneNumber&nbsp;=&nbsp;NullString(User.WorkPhone); <br> // Properties not exposed by AccountManager<br> <span>DirectoryEntry</span>&nbsp;details&nbsp;=&nbsp;(<span>DirectoryEntry</span>)up.GetUnderlyingObject(); details.Properties[<span>&quot;homePhone&quot;</span>].Value&nbsp;=&nbsp;NullString(User.HomePhone); details.Properties[<span>&quot;mobile&quot;</span>].Value&nbsp;=&nbsp;NullString(User.MobilePhone); details.Properties[<span>&quot;telephoneNumber&quot;</span>].Value&nbsp;=&nbsp;NullString(User.WorkPhone); details.Properties[<span>&quot;l&quot;</span>].Value&nbsp;=&nbsp;NullString(User.Location); <br> // Save changes up.Save(); } <span>private</span>&nbsp;<span>string</span>&nbsp;NullString(<span>string</span>&nbsp;Value) { <span>if</span>&nbsp;(<span>string</span>.IsNullOrWhiteSpace(Value)) <span>return</span>&nbsp;<span>null</span>; <span>else</span> <span>return</span>&nbsp;Value; }</pre> <p>This code was built and refned through many, many aritcles and forums. I am now wondering if there isn't some setting in our Active Directory that is blocking the Saves. We &quot;inherited&quot; our Active Directory from a team that, frankly, didn't know what they were doing. So I wouldn't be surprised.</p> <p>I know it's an old, heavily beaten dead horse. But does anybody have any ideas, either for code or in AD settings?</p> 2013-04-30T20:26:24-04:002013-04-30T20:26:24.727-04:00urn:uuid:00000000-0000-0000-0000-000004530802http://forums.asp.net/p/1705334/4530802.aspx/1?System+Runtime+InteropServices+COMException+The+server+is+not+operationalSystem.Runtime.InteropServices.COMException: The server is not operational <p>I have the following challenge:</p> <p>I have an ADLDS store and a webservice that can add users. The credentials are not in the web.config, but the app pool account has full control on the ADLDS.</p> <p>I created a user succesfully with an active directory membershipprovider.</p> <p>Now I want to set a property, so I try to retrieve the DirectoryEntry using the same&nbsp;connectionString as the membershipprovider (and pass Secure as the authenticationType), but as soon as it binds (System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)) this error is thrown:</p> <p>System.Runtime.InteropServices.COMException: The server is not operational</p> <p>Any idea what I could&nbsp;be doing wrong?</p> 2011-07-29T14:06:08-04:002011-07-29T14:06:08.153-04:00urn:uuid:00000000-0000-0000-0000-000005307678http://forums.asp.net/p/1883968/5307678.aspx/1?LDAP+DirectoryEntry+SearchResult+returns+data+differently+in+Windows+8+than+Win7LDAP DirectoryEntry SearchResult returns data differently in Windows 8 than Win7 <pre class="prettyprint">DirectoryEntry DEConnection = new DirectoryEntry(&quot;LDAP://directory.mydomain.com/dc=mydomain,dc=com&quot;); DEConnection.AuthenticationType = AuthenticationTypes.None; DirectorySearcher DESearch = new DirectorySearcher(); DESearch.SearchRoot = DEConnection; DESearch.Filter = &quot;(uid=&quot; &#43; txtNetID.Text &#43; &quot;)&quot;; try { SearchResult result = DESearch.FindOne(); if (result != null) { DirectoryEntry myDirectoryEntry = result.GetDirectoryEntry(); txtFullName.Text = myDirectoryEntry.Properties[&quot;displayName&quot;].Value.ToString(); txtFullName.Text = result.Properties[&quot;displayName&quot;][0].ToString();</pre> <p></p> <p>In Windows 7 the last two lines properly return a string containing the users displayName.</p> <p>In Windows 8 instead of a string value it returns System.Byte[].</p> <p>When examining the RESULT object during debugging the on Windows 8 the value is stored as a byte array of ascii values, where in Windows 7 it is stored as a string.</p> <p>As yet I've been unable to find a way to get the string value out in Windows 8, or find any documentation anywhere noting this difference.</p> <p>What is the easiest way to modify the code to work on both operating systems?</p> <p></p> 2013-02-20T03:22:36-05:002013-02-20T03:22:36.873-05:00urn:uuid:00000000-0000-0000-0000-000005380315http://forums.asp.net/p/1902854/5380315.aspx/1?Want+to+add+Helpdesk+functions+to+a+webpageWant to add Helpdesk functions to a webpage <p>I want to have a page on my internal website written in asp.net/vb that the helpdesk can go to and do the following functions:</p> <p>unlock user accounts, reset passwords, change passwords.</p> <p>&nbsp;</p> <p>possible adding the ability to add and remove user accounts from groups in AD.</p> <p>how hard is this to code?&nbsp; im not that great at coding - still learning.</p> 2013-04-30T19:29:34-04:002013-04-30T19:29:34.717-04:00urn:uuid:00000000-0000-0000-0000-000005380375http://forums.asp.net/p/1902871/5380375.aspx/1?Help+getting+all+Outlook+Active+Directory+usersHelp getting all "Outlook" Active Directory users <p>Could someone please help:&nbsp; I am trying to figure out a routine to fetch all active directory users (but only the ones that would appear in Microsoft Outlook.&nbsp; When I trying running the following two sets of code, I get all users including admin etc.&nbsp; How can I restrict the returned list to the users that would normally appear in outlook.</p> <p></p> <p>This is from some code that I found on the net.&nbsp; It works great for getting users that begin with char's.&nbsp; I found the code at http://www.codegain.com/articles/activedirtocry/miscellaneous/all-operations-on-active-directory-ad-using-c-sharp.aspx</p> <p>&nbsp;public List&lt;ADUserDetail&gt; GetUsersByFirstName(string fName)<br> &nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //UserProfile user;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;ADUserDetail&gt; userlist = new List&lt;ADUserDetail&gt;();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string filter = &quot;&quot;;<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _directoryEntry = null;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DirectorySearcher directorySearch = new DirectorySearcher(SearchRoot);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directorySearch.Asynchronous = true;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directorySearch.CacheResults = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; filter = string.Format(&quot;(givenName={0}*&quot;, fName);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter = &quot;(&amp;(objectClass=user)(objectCategory=person)(givenName=&quot; &#43; fName &#43; &quot;*))&quot;;<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directorySearch.Filter = filter;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directorySearch.ReferralChasing = ReferralChasingOption.All;<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SearchResultCollection userCollection = directorySearch.FindAll();<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (SearchResult users in userCollection)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DirectoryEntry userEntry = new DirectoryEntry(users.Path, LDAPUser, <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LDAPPassword);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADUserDetail userInfo = ADUserDetail.GetUser(userEntry); <br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userlist.Add(userInfo);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directorySearch.Filter = &quot;(&amp;(objectClass=group)(SAMAccountName=&quot; &#43; fName <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#43; &quot;*))&quot;;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SearchResultCollection results = directorySearch.FindAll();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (results != null)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (SearchResult r in results)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DirectoryEntry deGroup = new DirectoryEntry(r.Path, LDAPUser, <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LDAPPassword);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADUserDetail agroup = ADUserDetail.GetUser(deGroup);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userlist.Add(agroup);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return userlist;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p></p> <p>Also: I was able to find some code that does get all Users from Active directory, but again it literally get's all users.&nbsp; I want to filter the list to be equal to that of Outlook.</p> <p></p> <p>&nbsp;public List&lt;ADUserDetail&gt; GetAllUsers()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;ADUserDetail&gt; userlist = new List&lt;ADUserDetail&gt;();<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.DirectoryServices.AccountManagement.PrincipalContext AD = <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new System.DirectoryServices.AccountManagement.PrincipalContext(System.DirectoryServices.AccountManagement.ContextType.Domain, &quot;OurDomain.com&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.DirectoryServices.AccountManagement.UserPrincipal u = new System.DirectoryServices.AccountManagement.UserPrincipal(AD);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.DirectoryServices.AccountManagement.PrincipalSearcher search = new System.DirectoryServices.AccountManagement.PrincipalSearcher(u);<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (System.DirectoryServices.AccountManagement.UserPrincipal result in search.FindAll())<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (result.DisplayName != null)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string test = result.EmailAddress;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return userlist;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p></p> <p>I am obviously very lost trying to figure this stuff out.</p> <p></p> <p>thanks</p> <p></p> <p>Dave.</p> 2013-04-30T21:02:57-04:002013-04-30T21:02:57.973-04:00