That is a problem only on SAM based objects (groups, users, computers).
Anything that isn't SAM based can have multiple values. :) That makes it
even more fun.  


--
O'Reilly Active Directory Third Edition -
http://www.joeware.net/win/ad3e.htm 
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joe Kaplan
Sent: Thursday, December 28, 2006 12:24 PM
To: [email protected]
Subject: Re: [ActiveDir] DirectoryServices vb.net is broken.

They aren't equivalent.  Try using the .Value property instead:

user.Properties("description").Value = xxxx

Description is a funny property in AD in that the schema says that it allows

multiple values, but the DS itself will only allow it to contain a single 
value for backward compatibility with previous DS APIs.  That might be part 
of the problem here.

In any event, it is generally always good practice to use the .Value 
property to set a single value.  There is  more info on this in ch 6 of our 
book (www.directoryprogramming.net).

Joe K.

----- Original Message ----- 
From: "AD" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, December 28, 2006 10:13 AM
Subject: [ActiveDir] DirectoryServices vb.net is broken.


I have a user with no description attribute.

Anyone know why this works?

User.Invoke("put", New Object() {"description", txtBxNewDescription.Text})
User.commitChanges

but this doesn't

User.Properties("Description").Add(txtBxNewDescription.Text)
User.commitChanges

I get the following error message.

ComError {"A constraint violation occurred. (Exception from HRESULT: 
0x8007202F)"} System.DirectoryServices.DirectoryServicesCOMException

Thanks

Yves St-Cyr
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx 

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.activedir.org/ma/default.aspx

Reply via email to