Handling of this ADSVALUE type is not yet implemented (type = 0xb).

  • Thread starter Ágúst Kristinn Arnlaugsson
  • Start date
Á

Ágúst Kristinn Arnlaugsson

Hi,

Maybe this subject has come up before but here it goes.

Im using c# in asp.net and im connecting to ldap server to retrieve some
properties from it, some properties work ok but for others i get the error
mentioned in the subject line, im using DirectoryService and here is the
code.
I add 3 properties, cn wich is not multi value, mail wich is and objectClass
is multi also, objectClass is the one that generates the error(when i take
the try catch out).




**Code Start**
DirectorySearcher searcher = new DirectorySearcher();

searcher.SearchRoot = new DirectoryEntry(LDAP://someserver/cn=somewhere);

searcher.SearchScope = SearchScope.Subtree;

searcher.Filter = "(uid=some)";

searcher.PropertiesToLoad.Add("cn");
searcher.PropertiesToLoad.Add("mail");
searcher.PropertiesToLoad.Add("objectClass");

SearchResultCollection results = searcher.FindAll();

foreach(SearchResult result in results)
{
Response.Write("mail=" + result.Properties["mail"][0] + "<br>");

if (result.Properties["mail"].Count > 1)
{
for (int i = 0;i < result.Properties["mail"].Count;i++)
{
Response.Write("mail=" + result.Properties["mail"] + "<br>");
}
}
else
{
Response.Write("mail=" + result.Properties["mail"][0] + "<br>");
}


try
{
if (result.Properties["objectClass"].Count > 1)
{
for (int i = 0;i < result.Properties["objectClass"].Count;i++)
{
Response.Write("objectClass=" +
result.Properties["objectClass"].ToString() + "<br>");
}
}
else
{
Response.Write("objectClass=" +
result.Properties["objectClass"][0].ToString() + "<br>");
}
}
catch
{
Response.Write("Couldnt write objectClass Property<br>");
}
}

**Code End**



Any help appreciated.

Best Regards
Agust
 
G

Guest

Hi,

Ive tried a few things but cant seem to get it to work yet, im not connecting to AD but "3rd party" ldap server
I get the same error when i use winform instead of asp, i have managed to write out objectClass with vb script using getinfoex but it would be best if i could use .net and directoryservices

I know im connected to the ldap server cause if i change the pw i get an error and also im able to write out some properties and not others

Im totally lost, if anyone has any idea it would be appreciated

Best Regard
Ãgúst Kristinn Arnlaugsso

----- Ãgúst Kristinn Arnlaugsson wrote: ----

Hi

Maybe this subject has come up before but here it goes

Im using c# in asp.net and im connecting to ldap server to retrieve som
properties from it, some properties work ok but for others i get the erro
mentioned in the subject line, im using DirectoryService and here is th
code
I add 3 properties, cn wich is not multi value, mail wich is and objectClas
is multi also, objectClass is the one that generates the error(when i tak
the try catch out)




**Code Start*
DirectorySearcher searcher = new DirectorySearcher()

searcher.SearchRoot = new DirectoryEntry(LDAP://someserver/cn=somewhere)

searcher.SearchScope = SearchScope.Subtree

searcher.Filter = "(uid=some)"

searcher.PropertiesToLoad.Add("cn")
searcher.PropertiesToLoad.Add("mail")
searcher.PropertiesToLoad.Add("objectClass")

SearchResultCollection results = searcher.FindAll()

foreach(SearchResult result in results

Response.Write("mail=" + result.Properties["mail"][0] + "<br>")

if (result.Properties["mail"].Count > 1

for (int i = 0;i < result.Properties["mail"].Count;i++

Response.Write("mail=" + result.Properties["mail"] + "<br>")


els

Response.Write("mail=" + result.Properties["mail"][0] + "<br>")



tr

if (result.Properties["objectClass"].Count > 1

for (int i = 0;i < result.Properties["objectClass"].Count;i++

Response.Write("objectClass="
result.Properties["objectClass"].ToString() + "<br>")


els

Response.Write("objectClass="
result.Properties["objectClass"][0].ToString() + "<br>")


catc

Response.Write("Couldnt write objectClass Property<br>")



**Code End*



Any help appreciated

Best Regard
Agus
 
W

Willy Denoyette [MVP]

What directory server are you talking to, what version of LDAP does it
supports?
Did you try first using the adsedit tool?

Willy.
 
Á

Ágúst Kristinn Arnlaugsson

Hi,

Im talking to syntegra ldap server and it supports version 3.
I did try the adsedit tool but i was not able to connect through that, i get
"The requested authentication method is not supported by the server"
But i am able to retrieve some values through directoryservices in .net.

Best regards
Agust

Willy Denoyette said:
What directory server are you talking to, what version of LDAP does it
supports?
Did you try first using the adsedit tool?

Willy.

Ágúst Kristinn Arnlaugsson said:
Hi,

Ive tried a few things but cant seem to get it to work yet, im not
connecting to AD but "3rd party" ldap server.
I get the same error when i use winform instead of asp, i have managed to
write out objectClass with vb script using getinfoex but it would be best
if i could use .net and directoryservices.

I know im connected to the ldap server cause if i change the pw i get an
error and also im able to write out some properties and not others.

Im totally lost, if anyone has any idea it would be appreciated.

Best Regards
Ágúst Kristinn Arnlaugsson

----- Ágúst Kristinn Arnlaugsson wrote: -----

Hi,

Maybe this subject has come up before but here it goes.

Im using c# in asp.net and im connecting to ldap server to retrieve
some
properties from it, some properties work ok but for others i get the
error
mentioned in the subject line, im using DirectoryService and here is
the
code.
I add 3 properties, cn wich is not multi value, mail wich is and
objectClass
is multi also, objectClass is the one that generates the error(when i
take
the try catch out).




**Code Start**
DirectorySearcher searcher = new DirectorySearcher();

searcher.SearchRoot = new
DirectoryEntry(LDAP://someserver/cn=somewhere);

searcher.SearchScope = SearchScope.Subtree;

searcher.Filter = "(uid=some)";

searcher.PropertiesToLoad.Add("cn");
searcher.PropertiesToLoad.Add("mail");
searcher.PropertiesToLoad.Add("objectClass");

SearchResultCollection results = searcher.FindAll();

foreach(SearchResult result in results)
{
Response.Write("mail=" + result.Properties["mail"][0] + "<br>");

if (result.Properties["mail"].Count > 1)
{
for (int i = 0;i < result.Properties["mail"].Count;i++)
{
Response.Write("mail=" + result.Properties["mail"] + "<br>");
}
}
else
{
Response.Write("mail=" + result.Properties["mail"][0] +
}


try
{
if (result.Properties["objectClass"].Count > 1)
{
for (int i = 0;i < result.Properties["objectClass"].Count;i++)
{
Response.Write("objectClass=" +
result.Properties["objectClass"].ToString() + "<br>");
}
}
else
{
Response.Write("objectClass=" +
result.Properties["objectClass"][0].ToString() + "<br>");
}
}
catch
{
Response.Write("Couldnt write objectClass Property<br>");
}
}

**Code End**



Any help appreciated.

Best Regards
Agust

 
W

Willy Denoyette [MVP]

Adsiedit should work when using the same authentication methods/credentials
as the one used in your C# program, after alls the DirectoryServices classes
use the same COM classes as adsiedit.
First you should try to get at the Ldap server and retrieve your objects
using adsiedit, when this works move on with your own code.
Using the same authentication method/credential, try the same from a console
program using the DirectoryServices.
Only when this works you could move your code to asp.net.
Willy.

Ágúst Kristinn Arnlaugsson said:
Hi,

Im talking to syntegra ldap server and it supports version 3.
I did try the adsedit tool but i was not able to connect through that, i
get
"The requested authentication method is not supported by the server"
But i am able to retrieve some values through directoryservices in .net.

Best regards
Agust

Willy Denoyette said:
What directory server are you talking to, what version of LDAP does it
supports?
Did you try first using the adsedit tool?

Willy.

message
Hi,

Ive tried a few things but cant seem to get it to work yet, im not
connecting to AD but "3rd party" ldap server.
I get the same error when i use winform instead of asp, i have managed to
write out objectClass with vb script using getinfoex but it would be best
if i could use .net and directoryservices.

I know im connected to the ldap server cause if i change the pw i get
an
error and also im able to write out some properties and not others.

Im totally lost, if anyone has any idea it would be appreciated.

Best Regards
Ágúst Kristinn Arnlaugsson

----- Ágúst Kristinn Arnlaugsson wrote: -----

Hi,

Maybe this subject has come up before but here it goes.

Im using c# in asp.net and im connecting to ldap server to retrieve
some
properties from it, some properties work ok but for others i get
the
error
mentioned in the subject line, im using DirectoryService and here
is
the
code.
I add 3 properties, cn wich is not multi value, mail wich is and
objectClass
is multi also, objectClass is the one that generates the error(when i
take
the try catch out).




**Code Start**
DirectorySearcher searcher = new DirectorySearcher();

searcher.SearchRoot = new
DirectoryEntry(LDAP://someserver/cn=somewhere);

searcher.SearchScope = SearchScope.Subtree;

searcher.Filter = "(uid=some)";

searcher.PropertiesToLoad.Add("cn");
searcher.PropertiesToLoad.Add("mail");
searcher.PropertiesToLoad.Add("objectClass");

SearchResultCollection results = searcher.FindAll();

foreach(SearchResult result in results)
{
Response.Write("mail=" + result.Properties["mail"][0] + "<br>");

if (result.Properties["mail"].Count > 1)
{
for (int i = 0;i < result.Properties["mail"].Count;i++)
{
Response.Write("mail=" + result.Properties["mail"] +
"<br>");
}
}
else
{
Response.Write("mail=" + result.Properties["mail"][0] +
}


try
{
if (result.Properties["objectClass"].Count > 1)
{
for (int i = 0;i < result.Properties["objectClass"].Count;i++)
{
Response.Write("objectClass=" +
result.Properties["objectClass"].ToString() + "<br>");
}
}
else
{
Response.Write("objectClass=" +
result.Properties["objectClass"][0].ToString() + "<br>");
}
}
catch
{
Response.Write("Couldnt write objectClass Property<br>");
}
}

**Code End**



Any help appreciated.

Best Regards
Agust


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top