No such object on server error

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have an no such object is found on the following code i reposted from my earlier code because I decided to start a new thread instead of post to the old one again:
<span style="font-size:small <span style="font-size:small
Dim results1 As SearchResult<br/>
AD = New DirectoryEntry( LDAP://10.253.97.10/OU=TopOU,OU=Staff,DC=garrard,DC=ketsds,DC=net ,"","", AuthenticationTypes.Secure)<br/>
AD2 = New DirectoryEntry("LDAP://10.253.97.10/OU=_Exchange Resources,OU=Staff,DC=garrard,DC=ketsds,DC=net", "", "", AuthenticationTypes.Secure)<br/>
ADFind = New DirectorySearcher(AD)<br/>
groupname = "Garrard Co MS Teachers"<br/>
ADFind.Filter = "(&(objectCategory=user)(cn=" + userID + "))"<br/>
group = AD2.Children.Find("CN=" + groupname)<br/>
Add a single user to a group;
<br/>
results1 = ADFind.FindOne<br/>
DN = results.Properties("distinguishedName")(0).ToString()<br/>
group.Properties("member").Add(DN)<br/>
group.CommitChanges()<br/>
AD = Nothing<br/>
AD2 = Nothing<br/>
Exit Select<br/>
<a>

When running the code results1 = ADFind.FineOne returns no such object found on server from the above code

<hr class="sig Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to
suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/

View the full article
 
Back
Top