Home All Groups Group Topic Archive Search About
Author
9 Mar 2006 4:53 PM
adam
Hi All,

Little confused about adding users in ADAM.
I am able to add users to ADAM using the following code and the class
"user"

AuthTypes = AuthenticationTypes.Signing | AuthenticationTypes.Sealing |
AuthenticationTypes.Secure;

DirectoryEntry verifiedUser = new
DirectoryEntry("LDAP://"+serverName+":"+portNumber+"/"+partitionDir,"username","password",AuthTypes);

verifiedUser.RefreshCache();

strUserName = "CN=testUser";
try
{
objUser = verifiedUser.Children.Add(strUserName,"user");
objUser.CommitChanges();
}

But I want to use users to a differnt class say "publicPerson", this
class is already there but when I say the following it gives an error.

objUser = verifiedUser.Children.Add(strUserName,"publicPerson");
objUser.CommitChanges();

Error:

Server Error in '/ADAM' Application.
--------------------------------------------------------------------------------

The requested operation did not satisfy one or more constraints
associated with the class of the object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The
requested operation did not satisfy one or more constraints associated
with the class of the object.


Any help would be appreciated.
Thanks,

Author
9 Mar 2006 9:15 PM
Joe Kaplan (MVP - ADSI)
I'm not familiar with the schema definition for the "publicPerson" class,
but is it possible that it defines some "mustContain" attributes that need
to be specified at create time?  It might also be the case that it does not
use CN as the RDN Attribute, so you would not specify the name as "CN=xxxx".

You need to tell us more about this schema class if you want more specific
help.

Joe K.

Show quoteHide quote
"adam" <kumar***@gmail.com> wrote in message
news:1141923200.192967.184710@z34g2000cwc.googlegroups.com...
> Hi All,
>
> Little confused about adding users in ADAM.
> I am able to add users to ADAM using the following code and the class
> "user"
>
> AuthTypes = AuthenticationTypes.Signing | AuthenticationTypes.Sealing |
> AuthenticationTypes.Secure;
>
> DirectoryEntry verifiedUser = new
> DirectoryEntry("LDAP://"+serverName+":"+portNumber+"/"+partitionDir,"username","password",AuthTypes);
>
> verifiedUser.RefreshCache();
>
> strUserName = "CN=testUser";
> try
> {
> objUser = verifiedUser.Children.Add(strUserName,"user");
> objUser.CommitChanges();
> }
>
> But I want to use users to a differnt class say "publicPerson", this
> class is already there but when I say the following it gives an error.
>
> objUser = verifiedUser.Children.Add(strUserName,"publicPerson");
> objUser.CommitChanges();
>
> Error:
>
> Server Error in '/ADAM' Application.
> --------------------------------------------------------------------------------
>
> The requested operation did not satisfy one or more constraints
> associated with the class of the object.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
>
> Exception Details: System.Runtime.InteropServices.COMException: The
> requested operation did not satisfy one or more constraints associated
> with the class of the object.
>
>
> Any help would be appreciated.
> Thanks,
>
Author
9 Mar 2006 9:24 PM
Lee Flight
Hi

a likely cause of your probelm is that you are you are not specifying
a required (mandatory) attribute of the class that you are trying to
instantiate
or that you have a containment violation and the class you are trying to
instantiate cannot be a child of the parent container you are specifying.
It's difficult to be more specific without knowing what the classSchema
"publicPerson" definition is.

Also for System.DirectoryServices questions it usually a better idea to
post to the adsi.general newsgroup.

Lee Flight

Show quoteHide quote
"adam" <kumar***@gmail.com> wrote in message
news:1141923200.192967.184710@z34g2000cwc.googlegroups.com...
> Hi All,
>
> Little confused about adding users in ADAM.
> I am able to add users to ADAM using the following code and the class
> "user"
>
> AuthTypes = AuthenticationTypes.Signing | AuthenticationTypes.Sealing |
> AuthenticationTypes.Secure;
>
> DirectoryEntry verifiedUser = new
> DirectoryEntry("LDAP://"+serverName+":"+portNumber+"/"+partitionDir,"username","password",AuthTypes);
>
> verifiedUser.RefreshCache();
>
> strUserName = "CN=testUser";
> try
> {
> objUser = verifiedUser.Children.Add(strUserName,"user");
> objUser.CommitChanges();
> }
>
> But I want to use users to a differnt class say "publicPerson", this
> class is already there but when I say the following it gives an error.
>
> objUser = verifiedUser.Children.Add(strUserName,"publicPerson");
> objUser.CommitChanges();
>
> Error:
>
> Server Error in '/ADAM' Application.
> --------------------------------------------------------------------------------
>
> The requested operation did not satisfy one or more constraints
> associated with the class of the object.
> Description: An unhandled exception occurred during the execution of
> the current web request. Please review the stack trace for more
> information about the error and where it originated in the code.
>
> Exception Details: System.Runtime.InteropServices.COMException: The
> requested operation did not satisfy one or more constraints associated
> with the class of the object.
>
>
> Any help would be appreciated.
> Thanks,
>
Author
10 Mar 2006 12:58 AM
Dmitri Gavrilov [MSFT]
Another possible problem -- publicPerson class definition needs to list the
class of partitionDir (container? organizationalUnit?) as one of its
possSuperiors.

--
Dmitri Gavrilov
SDE, DS Admin eXperience

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Show quoteHide quote
"Lee Flight" <l**@le.ac.uk-nospam> wrote in message
news:uHFaR$7QGHA.196@TK2MSFTNGP10.phx.gbl...
> Hi
>
> a likely cause of your probelm is that you are you are not specifying
> a required (mandatory) attribute of the class that you are trying to
> instantiate
> or that you have a containment violation and the class you are trying to
> instantiate cannot be a child of the parent container you are specifying.
> It's difficult to be more specific without knowing what the classSchema
> "publicPerson" definition is.
>
> Also for System.DirectoryServices questions it usually a better idea to
> post to the adsi.general newsgroup.
>
> Lee Flight
>
> "adam" <kumar***@gmail.com> wrote in message
> news:1141923200.192967.184710@z34g2000cwc.googlegroups.com...
>> Hi All,
>>
>> Little confused about adding users in ADAM.
>> I am able to add users to ADAM using the following code and the class
>> "user"
>>
>> AuthTypes = AuthenticationTypes.Signing | AuthenticationTypes.Sealing |
>> AuthenticationTypes.Secure;
>>
>> DirectoryEntry verifiedUser = new
>> DirectoryEntry("LDAP://"+serverName+":"+portNumber+"/"+partitionDir,"username","password",AuthTypes);
>>
>> verifiedUser.RefreshCache();
>>
>> strUserName = "CN=testUser";
>> try
>> {
>> objUser = verifiedUser.Children.Add(strUserName,"user");
>> objUser.CommitChanges();
>> }
>>
>> But I want to use users to a differnt class say "publicPerson", this
>> class is already there but when I say the following it gives an error.
>>
>> objUser = verifiedUser.Children.Add(strUserName,"publicPerson");
>> objUser.CommitChanges();
>>
>> Error:
>>
>> Server Error in '/ADAM' Application.
>> --------------------------------------------------------------------------------
>>
>> The requested operation did not satisfy one or more constraints
>> associated with the class of the object.
>> Description: An unhandled exception occurred during the execution of
>> the current web request. Please review the stack trace for more
>> information about the error and where it originated in the code.
>>
>> Exception Details: System.Runtime.InteropServices.COMException: The
>> requested operation did not satisfy one or more constraints associated
>> with the class of the object.
>>
>>
>> Any help would be appreciated.
>> Thanks,
>>
>
>