LDAP modify multivalue attribute

19 views
Skip to first unread message

nma...@nospam.nospam

unread,
Oct 13, 2008, 5:47:05 PM10/13/08
to
Need help with some LDAP syntax. I'm trying to add another value to a
multi-value User attribute (mail for example) in active directory. But
when I use the Add operation I get the LDAP Error 20 "Attribute Or Value
Exists". I tried looking around for an answer with no luck. I'm
wondering if I have to do the Replace operation even though that seems
inefficient. Thanks for the help.

Nate

Joe Kaplan

unread,
Oct 14, 2008, 12:13:45 AM10/14/08
to
Normally you use an add operation if you want to add a new value. Replace
would not be the way to go, although it probably isn't a big deal if there
are just a few values and you don't mind rewriting it. You normally get
this error if you try to add a value that already exists (which is not
allowed). Are you sure your value is unique?

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
<nma...@nospam.nospam> wrote in message
news:op.uizf4...@nmaier1.unimax.com...

Richard Mueller [MVP]

unread,
Oct 14, 2008, 7:44:11 AM10/14/08
to

<nma...@nospam.nospam> wrote in message
news:op.uizf4...@nmaier1.unimax.com...

Does this link help?

http://www.microsoft.com/technet/scriptcenter/scripts/ad/users/modify/usmdvb03.mspx

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


nma...@nospam.nospam

unread,
Oct 14, 2008, 12:05:19 PM10/14/08
to
On Mon, 13 Oct 2008 23:13:45 -0500, Joe Kaplan
<joseph....@removethis.accenture.com> wrote:

> Normally you use an add operation if you want to add a new value.
> Replace
> would not be the way to go, although it probably isn't a big deal if
> there
> are just a few values and you don't mind rewriting it. You normally get
> this error if you try to add a value that already exists (which is not
> allowed). Are you sure your value is unique?
>
> Joe K.


Thanks Joe and Richard for the replies. Found out the problem, it was
user error...sorry. The 'mail' attribute isn't multivalue. I
experimented with otherTelephone and that worked fine. I think I assumed
'mail' was multivalued based off it's schema common name of
"E-mail-Addresses". Thanks for the help.

Nate

Joe Kaplan

unread,
Oct 14, 2008, 9:24:49 PM10/14/08
to
That's interesting because I would have expected a constraint violation
error in that case, but I'm still frequently surprised by the directory. :)

If you are using Exchange, you usually add the additional email addresses to
proxyAddresses.

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
>
>

Reply all
Reply to author
Forward
0 new messages