The error message:
Active Directory (0x8000500C)
The Active Directory datatype cannot be converted to/from
a native DS datatype
I´ve tried the suggestions on the
http://support.microsoft.com/default.aspx?scid=kb;en-
us;Q241981 page but it didn't work.
I´ve also tried updating the cache like suggested here in
reply to Samba on the 18th. of April 2002. (same problem)
It too didn´t work.
I´ve looked at the schema definitions for department and
title and they are exactly the same although I can query
title but not department.
-----------------------------------------------------------
-------------------------------------------------------
Here´s my code:
strADsPath = LDAP://DC=xyz,DC=is
strBase = "<" & strADsPath & ">"
Set adoConnection = Server.CreateObject
("ADODB.Connection")
adoConnection.Open "Provider= ADsDSOObject"
Set adoCommand = Server.CreateObject("ADODB.Command")
Set adoCommand.ActiveConnection = adoConnection
strObjects = "(objectClass='user')"
strFilter = "(" & strObjects & ")"
strAttributes = "cn,department,title"
strScope = "subTree"
adoCommand.CommandText = strBase & ";" & strFilter & ";" &
strAttributes & ";" & strScope
adoCommand.Properties("Sort On") = "cn"
'****The execution fails if I have the department
attribute specified in strAttributes, If I don´t
everything works perfectly.
Set adoRS = adoCommand.Execute
-----------------------------------------------------------
-----------------------------------------------------------
---
Thanks in advance,
Linda
System.NotImplementedException: Handling of this ADSVALUE type is not yet implemented (type = 0xb).
on department and company.
The odd thing is that the same exact VBscript works perfectly as a .vbs program.
This together with the fact that there are multiple ways of doing the same thing and multiple ways of referring to the same object,
each of which seems to have their own idiosyncrasies/bugs, I'm about to dump ADSI.
"lbb" <lindabja...@hotmail.com> wrote in message news:a63201c20c73$0780d050$36ef2ecf@tkmsftngxa12...
I惴 reading user attributes from AD onto an ASP page. When
I read certain attributes I get either an unspecified
error or the error message here below, depending on what
code I use. There seem to be alot of people struggling
with this error, I would really appreciate it if someone
would take the time to look at it.
The error message:
Active Directory (0x8000500C)
The Active Directory datatype cannot be converted to/from
a native DS datatype
I扉e tried the suggestions on the
http://support.microsoft.com/default.aspx?scid=kb;en-
us;Q241981 page but it didn't work.
I扉e also tried updating the cache like suggested here in
reply to Samba on the 18th. of April 2002. (same problem)
It too didn愒 work.
I扉e looked at the schema definitions for department and
title and they are exactly the same although I can query
title but not department.
-----------------------------------------------------------
-------------------------------------------------------
Here愀 my code:
strADsPath = LDAP://DC=xyz,DC=is
strBase = "<" & strADsPath & ">"
Set adoConnection = Server.CreateObject
("ADODB.Connection")
adoConnection.Open "Provider= ADsDSOObject"
Set adoCommand = Server.CreateObject("ADODB.Command")
Set adoCommand.ActiveConnection = adoConnection
strObjects = "(objectClass='user')"
strFilter = "(" & strObjects & ")"
strAttributes = "cn,department,title"
strScope = "subTree"
adoCommand.CommandText = strBase & ";" & strFilter & ";" &
strAttributes & ";" & strScope
adoCommand.Properties("Sort On") = "cn"
'****The execution fails if I have the department
attribute specified in strAttributes, If I don愒
TIA, Bruno Lopes
NOTE: company and department (which have values) throw the 'NotImplementedException' while employeeID, manager, employeeNumber throw
a NullReferenceException (because they are null)
<%@Assembly Name="System.DirectoryServices, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"%>
<%@ Page Language="vb" Debug = "True" Trace="False"%>
<%@ Import Namespace="System"%>
<%@ Import Namespace = "System.DirectoryServices"%>
<html>
<head>
<title>ASP.Net</title>
</head>
<body>
<script language="VB" runat="server">
Sub Page_Load (sender As Object, e As EventArgs)
Dim root As New
System.DirectoryServices.DirectoryEntry("LDAP://dep.govt.state.ma.us/DC=dep,DC=govt,DC=state,DC=ma,DC=us","STravis", "JeepTJ#14")
Dim searcher As New System.DirectoryServices.DirectorySearcher(root)
Dim alias1 As String
searcher.Filter = ("sAMAccountName=STravis")
Dim results As SearchResultCollection
results = searcher.FindAll()
Dim result As SearchResult
For Each result In results
'Response.Write(result.Properties("employeeID")(0))
Response.Write(result.Properties("givenName")(0))
Response.Write(result.Properties("sn")(0))
Response.Write(result.Properties("cn")(0))
Response.Write(result.Properties("telephoneNumber")(0))
Response.Write(result.Properties("mail")(0))
Response.Write(result.Properties("description")(0))
Response.Write(result.Properties("title")(0))
Response.Write(result.Properties("physicalDeliveryOfficeName")(0))
'Response.Write(result.Properties("company")(0))
'Response.Write(result.Properties("manager")(0))
Response.Write(result.Properties("department")(0))
'Response.Write(result.Properties("employeeNumber")(0))
Next result
End Sub
</script>
</body>
</html>
"Bruno Lopes" <winte...@aeiou.pt> wrote in message news:3CFF89A2...@aeiou.pt...
--
Stephen Travis,
Microsoft MVP - FrontPage
"Bruno Lopes" <winte...@aeiou.pt> wrote in message news:3CFF94C...@aeiou.pt...
--
Stephen Travis,
Microsoft MVP - FrontPage
"Stephen Travis" <str...@iname.com> wrote in message news:OKtsAyWDCHA.1544@tkmsftngp02...
Dave Stucki
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Is there field level security is AD that would allow access via a .vbs script but not via ASP? Can I point my admin at a particular
security configuration setting?
--
Stephen Travis
Microsoft MVP - FrontPage
"David Stucki [MS]" <a-d...@online.microsoft.com> wrote in message news:qoozHyaDCHA.1600@cpmsftngxa08...
TIA, Bruno Lopes
using System;
using ActiveDs;
using System.DirectoryServices;
namespace Microsoft.PropertyInterfaces
{
class MainClass
{
[STAThread]
static void Main(string[] args)
{
DirectoryEntry group = new
DirectoryEntry("LDAP://CN=Domain
Admins,CN=Users,DC=dsdom,DC=extest,DC=microsoft,DC=com");
foreach(string member in
PropertyHelper.GetProperty(group,"member", ADSTYPEENUM.ADSTYPE_DN_STRING))
{
Console.WriteLine(member);
}
}
}
class PropertyHelper
{
public static object[] GetProperty(DirectoryEntry entry, string
propertyName, ADSTYPEENUM adsType)
{
//Make sure to get this value from the LDAP directory
entry.RefreshCache(new string[]{propertyName});
//QI for the IADsPropertyList interface from the
underlying IADs
IADsPropertyList propList =
(IADsPropertyList)entry.NativeObject;
//Get this property's IADsPropertyEntry
IADsPropertyEntry propEntry =
(IADsPropertyEntry)propList.GetPropertyItem(propertyName,(int)adsType);
//Use this ArrayList to build the array of return values
System.Collections.ArrayList values = new
System.Collections.ArrayList();
//Loop through each value in the collection
foreach(IADsPropertyValue propValue in
(object[])propEntry.Values)
{
switch(adsType)
{
case ADSTYPEENUM.ADSTYPE_CASE_IGNORE_STRING:
values.Add(propValue.CaseIgnoreString);
break;
case ADSTYPEENUM.ADSTYPE_CASE_EXACT_STRING:
values.Add(propValue.CaseExactString);
break;
case ADSTYPEENUM.ADSTYPE_DN_STRING:
values.Add(propValue.DNString);
break;
case ADSTYPEENUM.ADSTYPE_INTEGER:
values.Add(propValue.Integer);
break;
case ADSTYPEENUM.ADSTYPE_BOOLEAN:
values.Add(propValue.Boolean);
break;
case ADSTYPEENUM.ADSTYPE_LARGE_INTEGER:
values.Add(propValue.LargeInteger);
break;
case ADSTYPEENUM.ADSTYPE_OCTET_STRING:
values.Add(propValue.OctetString);
break;
default:
throw new
System.NotImplementedException("Handling of this ADSTYPE is not
implemented");
}
}
return values.ToArray();
}
}
}
Hope this helps!
May I suggest to put this sample code somewhere people can find when
searching for "System.NotImplementedException: Handling of this ADSVALUE
type is not yet implemented (type = 0xb)." or "Active Directory (0x8000500C)
The Active Directory datatype cannot be converted to/from
a native DS datatype" ? Or is this more likely to be a problem with the
LDAP server and schemas?
Thanks a whole bunch!
Bruno Lopes
David Stucki [MS] wrote:
> If you're trying to contact an LDAP server that isn't the AD it may be a
> schema problem. ADSI/DirectoryServices tries to read the schema
> information to know how to handle data returned from an v3 LDAP Server.
> Some third-party servers don't do this correctly, sometimes ADSI isn't
> expecting schema definitions that don't exist in the AD. Anyway, it looks
> like ADSI may not know how to handle the data. You could try to work
> around using the IADsProperty* interfaces. Here's a sample with a
> Class/Function that you can just call from your code, you shouldn't have to
> change any of the code in the PropertyHelper class, just use it in your
> code.
>
<SNIP>