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 9 3547
On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:
¤ 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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:
¤ 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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
sure, I'm using System.DirectoryServices
objRaizActiveDirectory = new DirectoryEntry(v_strRutaActiveDirectory);
DirectoryEntry objNuevoUsuario =
objRaizActiveDirectory.Children.Add("CN="+strNombr eCompleto, "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_objContenedorUsuar io.obtenerDescripcion());
invocarPropiedad(ref
objNuevoUsuario,"sAMAccountName",v_objContenedorUs uario.obtenerLogin());
/* Seccion de atributos extendidos de Active Directory */
/* Para detalles ver: http://www.microsoft.com/latam/techn...ws2k/chapt-20/ */
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute1",v_objContene dorUsuario.obtenerCedula()
);
/*
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute2",v_objContene dorUsuario.obtenerCorreoEl
ectronico());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute3",v_objContene dorUsuario.obtenerDepartam
ento());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute4",v_objContene dorUsuario.obtenerEntidad(
));
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute5",v_objContene dorUsuario.obtenerJefeDire
cto());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute6",v_objContene dorUsuario.obtenerNombre()
);
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute7",v_objContene dorUsuario.obtenerPrimerAp
ellido());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute8",v_objContene dorUsuario.obtenerPuesto()
);
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute9",v_objContene dorUsuario.obtenerSegundoA
pellido());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute10",v_objConten edorUsuario.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();
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:3m********************************@4ax.com... On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez"
<mr********@avantica.net> wrote: ¤ 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 ~~~ pc******@ameritech.net Microsoft MVP (Visual Basic)
sure, I'm using System.DirectoryServices
objRaizActiveDirectory = new DirectoryEntry(v_strRutaActiveDirectory);
DirectoryEntry objNuevoUsuario =
objRaizActiveDirectory.Children.Add("CN="+strNombr eCompleto, "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_objContenedorUsuar io.obtenerDescripcion());
invocarPropiedad(ref
objNuevoUsuario,"sAMAccountName",v_objContenedorUs uario.obtenerLogin());
/* Seccion de atributos extendidos de Active Directory */
/* Para detalles ver: http://www.microsoft.com/latam/techn...ws2k/chapt-20/ */
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute1",v_objContene dorUsuario.obtenerCedula()
);
/*
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute2",v_objContene dorUsuario.obtenerCorreoEl
ectronico());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute3",v_objContene dorUsuario.obtenerDepartam
ento());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute4",v_objContene dorUsuario.obtenerEntidad(
));
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute5",v_objContene dorUsuario.obtenerJefeDire
cto());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute6",v_objContene dorUsuario.obtenerNombre()
);
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute7",v_objContene dorUsuario.obtenerPrimerAp
ellido());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute8",v_objContene dorUsuario.obtenerPuesto()
);
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute9",v_objContene dorUsuario.obtenerSegundoA
pellido());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute10",v_objConten edorUsuario.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();
"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:3m********************************@4ax.com... On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez"
<mr********@avantica.net> wrote: ¤ 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 ~~~ pc******@ameritech.net Microsoft MVP (Visual Basic)
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.
"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:ON*************@TK2MSFTNGP10.phx.gbl... sure, I'm using System.DirectoryServices
objRaizActiveDirectory = new DirectoryEntry(v_strRutaActiveDirectory);
DirectoryEntry objNuevoUsuario = objRaizActiveDirectory.Children.Add("CN="+strNombr eCompleto, "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_objContenedorUsuar io.obtenerDescripcion());
invocarPropiedad(ref objNuevoUsuario,"sAMAccountName",v_objContenedorUs uario.obtenerLogin());
/* Seccion de atributos extendidos de Active Directory */
/* Para detalles ver: http://www.microsoft.com/latam/techn...ws2k/chapt-20/ */
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute1",v_objContene dorUsuario.obtenerCedula() );
/*
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute2",v_objContene dorUsuario.obtenerCorreoEl ectronico());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute3",v_objContene dorUsuario.obtenerDepartam ento());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute4",v_objContene dorUsuario.obtenerEntidad( ));
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute5",v_objContene dorUsuario.obtenerJefeDire cto());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute6",v_objContene dorUsuario.obtenerNombre() );
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute7",v_objContene dorUsuario.obtenerPrimerAp ellido());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute8",v_objContene dorUsuario.obtenerPuesto() );
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute9",v_objContene dorUsuario.obtenerSegundoA pellido());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute10",v_objConten edorUsuario.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();
"Paul Clement" <Us***********************@swspectrum.com> wrote in message news:3m********************************@4ax.com... On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote: ¤ 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 ~~~ pc******@ameritech.net Microsoft MVP (Visual Basic)
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.
"Mario Rodriguez" <mr********@avantica.net> wrote in message
news:ON*************@TK2MSFTNGP10.phx.gbl... sure, I'm using System.DirectoryServices
objRaizActiveDirectory = new DirectoryEntry(v_strRutaActiveDirectory);
DirectoryEntry objNuevoUsuario = objRaizActiveDirectory.Children.Add("CN="+strNombr eCompleto, "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_objContenedorUsuar io.obtenerDescripcion());
invocarPropiedad(ref objNuevoUsuario,"sAMAccountName",v_objContenedorUs uario.obtenerLogin());
/* Seccion de atributos extendidos de Active Directory */
/* Para detalles ver: http://www.microsoft.com/latam/techn...ws2k/chapt-20/ */
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute1",v_objContene dorUsuario.obtenerCedula() );
/*
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute2",v_objContene dorUsuario.obtenerCorreoEl ectronico());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute3",v_objContene dorUsuario.obtenerDepartam ento());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute4",v_objContene dorUsuario.obtenerEntidad( ));
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute5",v_objContene dorUsuario.obtenerJefeDire cto());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute6",v_objContene dorUsuario.obtenerNombre() );
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute7",v_objContene dorUsuario.obtenerPrimerAp ellido());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute8",v_objContene dorUsuario.obtenerPuesto() );
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute9",v_objContene dorUsuario.obtenerSegundoA pellido());
invocarPropiedad(ref objNuevoUsuario,"extensionAttribute10",v_objConten edorUsuario.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();
"Paul Clement" <Us***********************@swspectrum.com> wrote in message news:3m********************************@4ax.com... On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote: ¤ 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 ~~~ pc******@ameritech.net Microsoft MVP (Visual Basic)
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
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:#3**************@tk2msftngp13.phx.gbl... 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.
"Mario Rodriguez" <mr********@avantica.net> wrote in message news:ON*************@TK2MSFTNGP10.phx.gbl... sure, I'm using System.DirectoryServices
objRaizActiveDirectory = new DirectoryEntry(v_strRutaActiveDirectory);
DirectoryEntry objNuevoUsuario = objRaizActiveDirectory.Children.Add("CN="+strNombr eCompleto, "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_objContenedorUsuar io.obtenerDescripcion()); invocarPropiedad(ref objNuevoUsuario,"sAMAccountName",v_objContenedorUs uario.obtenerLogin());
/* Seccion de atributos extendidos de Active Directory */
/* Para detalles ver: http://www.microsoft.com/latam/techn...ws2k/chapt-20/ */
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute1",v_objContene dorUsuario.obtenerCedula() );
/*
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute2",v_objContene dorUsuario.obtenerCorreoEl ectronico());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute3",v_objContene dorUsuario.obtenerDepartam ento());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute4",v_objContene dorUsuario.obtenerEntidad( ));
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute5",v_objContene dorUsuario.obtenerJefeDire cto());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute6",v_objContene dorUsuario.obtenerNombre() );
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute7",v_objContene dorUsuario.obtenerPrimerAp ellido());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute8",v_objContene dorUsuario.obtenerPuesto() );
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute9",v_objContene dorUsuario.obtenerSegundoA pellido());
invocarPropiedad(ref
objNuevoUsuario,"extensionAttribute10",v_objConten edorUsuario.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();
"Paul Clement" <Us***********************@swspectrum.com> wrote in
message news:3m********************************@4ax.com... On Wed, 28 Apr 2004 09:49:22 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote: ¤ 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 ~~~ pc******@ameritech.net Microsoft MVP (Visual Basic)
On Wed, 28 Apr 2004 14:16:18 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:
¤ 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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
On Wed, 28 Apr 2004 14:16:18 -0600, "Mario Rodriguez" <mr********@avantica.net> wrote:
¤ 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 ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic) This discussion thread is closed Replies have been disabled for this discussion. Similar topics
2 posts
views
Thread by James Allan |
last post: by
|
1 post
views
Thread by Amadelle |
last post: by
|
reply
views
Thread by RTT |
last post: by
|
9 posts
views
Thread by Mario Rodriguez |
last post: by
|
8 posts
views
Thread by cgd |
last post: by
| |
1 post
views
Thread by Tim |
last post: by
| | | | | | | | | | | | |