Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / April 2004

Tip: Looking for answers? Try searching our database.

windows2003 active directory problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mario Rodriguez - 28 Apr 2004 16:49 GMT
Hi people. I have a problem adding users to Win2003 active directory
programatically.  When I execute my app throws the following exception:

................The specified directory service attribute or value does not
exist...........

Exactly the same code works fine on my win2000 active directory.  My app
include the use of the extensionAtributes and I'm not sure if the
extensionAttributes feature was removed from win2003 Active Directory

Any Idea
Paul Clement - 28 Apr 2004 19:42 GMT
¤ Hi people. I have a problem adding users to Win2003 active directory
¤ programatically.  When I execute my app throws the following exception:
¤
¤ ................The specified directory service attribute or value does not
¤ exist...........
¤
¤ Exactly the same code works fine on my win2000 active directory.  My app
¤ include the use of the extensionAtributes and I'm not sure if the
¤ extensionAttributes feature was removed from win2003 Active Directory

You may want to identify what attributes you are referring to (code?). I'm assuming you're using
either ADSI or System.DirectoryServices?

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
Mario Rodriguez - 28 Apr 2004 20:06 GMT
sure, I'm using System.DirectoryServices

objRaizActiveDirectory = new DirectoryEntry(v_strRutaActiveDirectory);

DirectoryEntry objNuevoUsuario =
objRaizActiveDirectory.Children.Add("CN="+strNombreCompleto, "user");

/* seccion de atributos obligatorios de Active Directory */

invocarPropiedad(ref objNuevoUsuario,"name",strNombreCompleto);

invocarPropiedad(ref
objNuevoUsuario,"givenName",v_objContenedorUsuario.obtenerNombre());

invocarPropiedad(ref
objNuevoUsuario,"Description",v_objContenedorUsuario.obtenerDescripcion());

invocarPropiedad(ref
objNuevoUsuario,"sAMAccountName",v_objContenedorUsuario.obtenerLogin());

/* Seccion de atributos extendidos de Active Directory */

/* Para detalles ver:
http://www.microsoft.com/latam/technet/articulos/windows2k/chapt-20/ */

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute1",v_objContenedorUsuario.obtenerCedula()
);

/*

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute2",v_objContenedorUsuario.obtenerCorreoEl
ectronico());

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute3",v_objContenedorUsuario.obtenerDepartam
ento());

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute4",v_objContenedorUsuario.obtenerEntidad(
));

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute5",v_objContenedorUsuario.obtenerJefeDire
cto());

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute6",v_objContenedorUsuario.obtenerNombre()
);

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute7",v_objContenedorUsuario.obtenerPrimerAp
ellido());

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute8",v_objContenedorUsuario.obtenerPuesto()
);

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute9",v_objContenedorUsuario.obtenerSegundoA
pellido());

invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute10",v_objContenedorUsuario.obtenerTelefon
o());

invocarPropiedad(ref objNuevoUsuario,"extensionAttribute11"," "); // define
el campo de fechaExpiracion

*/

/* se crea el usuario y luego se define el password, de lo contrario Active
Directory tira una exception */

objNuevoUsuario.CommitChanges();

//objNuevoUsuario.Invoke("SetPassword", new
object[]{v_objContenedorUsuario.obtenerClave()});

/* Se habilita el usuario en Active Directory */

objNuevoUsuario.Properties["userAccountControl"].Value = 0x200;
//ADS_UF_NORMAL_ACCOUNT

objNuevoUsuario.CommitChanges();

> ? Hi people. I have a problem adding users to Win2003 active directory
> ? programatically.  When I execute my app throws the following exception:
> ?
> ? ................The specified directory service attribute or value does
not
> ? exist...........
> ?
[quoted text clipped - 7 lines]
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)
Willy Denoyette [MVP] - 28 Apr 2004 20:47 GMT
These are exchange extension attributes, did you migrate a W2K AD to W2K3 AD
or did you upgrade an existing W2K AD domain?
If not, did you migrate Exchange to the new domain, else these attributes
don't exist in the user schema. You can check your schema using adsiedit.msc

Anyway rest assured these attributes still exist, and your problem is not
.NET related.
Willy.

> sure, I'm using System.DirectoryServices
>
[quoted text clipped - 107 lines]
>> Paul ~~~ pclement@ameritech.net
>> Microsoft MVP (Visual Basic)
Mario Rodriguez - 28 Apr 2004 21:16 GMT
You are right Willy. In fact, I've two test environments:

1- Win2000, Exchange installed - everything works fine
2- Win2003, without Exchange - tests fails

I just create manually all the extensionAttributeN in win2003 (using the
same data than un Win2000)

but now if I include some extensionAttribute on my addUser method throws an
exception (If I don't include any extensionAttribute everything works fine)

Exception:  The requested operation did not satisfy one or more constraints
associated with the class of the object.

Any Idea

> These are exchange extension attributes, did you migrate a W2K AD to W2K3 AD
> or did you upgrade an existing W2K AD domain?
[quoted text clipped - 20 lines]
> >
> > invocarPropiedad(ref

objNuevoUsuario,"Description",v_objContenedorUsuario.obtenerDescripcion());

> > invocarPropiedad(ref
> > objNuevoUsuario,"sAMAccountName",v_objContenedorUsuario.obtenerLogin());
[quoted text clipped - 5 lines]
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute1",v_objContenedorUsuario.obtenerCedula()
> > );
> >
> > /*
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute2",v_objContenedorUsuario.obtenerCorreoEl
> > ectronico());
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute3",v_objContenedorUsuario.obtenerDepartam
> > ento());
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute4",v_objContenedorUsuario.obtenerEntidad(
> > ));
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute5",v_objContenedorUsuario.obtenerJefeDire
> > cto());
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute6",v_objContenedorUsuario.obtenerNombre()
> > );
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute7",v_objContenedorUsuario.obtenerPrimerAp
> > ellido());
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute8",v_objContenedorUsuario.obtenerPuesto()
> > );
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute9",v_objContenedorUsuario.obtenerSegundoA
> > pellido());
> >
> > invocarPropiedad(ref

objNuevoUsuario,"extensionAttribute10",v_objContenedorUsuario.obtenerTelefon
> > o());
> >
[quoted text clipped - 42 lines]
> >> Paul ~~~ pclement@ameritech.net
> >> Microsoft MVP (Visual Basic)
Paul Clement - 30 Apr 2004 15:28 GMT
¤ You are right Willy. In fact, I've two test environments:
¤
¤ 1- Win2000, Exchange installed - everything works fine
¤ 2- Win2003, without Exchange - tests fails
¤
¤ I just create manually all the extensionAttributeN in win2003 (using the
¤ same data than un Win2000)
¤
¤ but now if I include some extensionAttribute on my addUser method throws an
¤ exception (If I don't include any extensionAttribute everything works fine)
¤
¤ Exception:  The requested operation did not satisfy one or more constraints
¤ associated with the class of the object.
¤

Can you try adding one extension attribute at a time until you trigger the error? This will allow
you identify the attribute in question (if it isn't all of them).

The error seems to indicate that there is a configuration or data related issue. It could be a data
validation issue or possibly a relationship between attributes that is being violated.

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.