Adding an attribute with multiple values.

Hi,

It maybe a simple question. But I'm having some troubles with it.
I'm using Net::LDAP::Entry and I'm trying to add an attribute with
multiple values.
Unfortunately, until now it didn't work out.

A simple example:

attr: value1
attr: value2

Just calling entry's add method multiple times does not worked out.
Replace method didn't work out ether. 

Maybe I'm doing something wrong.

Could someone give me an better idea or exemple on how to solve this problem?

Thanks in advance,

-- 
Relho de Couro
0
relho
11/11/2004 8:15:52 PM
perl.ldap 1268 articles. 0 followers. Follow

1 Replies
506 Views

Similar Articles

[PageSpeed] 29

On 11/11/04 8:15 pm, Relho de Couro <relho.de.couro@gmail.com> wrote:

> Hi,
> 
> It maybe a simple question. But I'm having some troubles with it.
> I'm using Net::LDAP::Entry and I'm trying to add an attribute with
> multiple values.
> Unfortunately, until now it didn't work out.
> 
> A simple example:
> 
> attr: value1
> attr: value2
> 
> Just calling entry's add method multiple times does not worked out.
> Replace method didn't work out ether.
> 
> Maybe I'm doing something wrong.
> 
> Could someone give me an better idea or exemple on how to solve this problem?

It works for me:

$e = Net::LDAP::Entry->new;
$e->dn("cn=Test User,c=RU");
$e->add("objectclass" => [qw(top person)]);
$e->add("sn" => "User");
$e->add("cn" => "Test User");
$e->add("sn" => "Frob");
$res = $e->update($ldap);

The resulting entry has two values for sn.

Cheers,

Chris


0
chrisridd
11/11/2004 9:04:47 PM
Reply:

Similar Artilces:

add values to multiple-valued attribute error
try add multiple values to a mulitple-valued attribute (that can be done with a GUI / LDIF).However, use following code, I get error when insert multiple values for Properties("mgrpRFC822MailMember") (but it works with only one entry)Any help is very welcome.Thx Dim de1 = New DirectoryEntry("LDAP://" & ldapServerName & _            "/ou=MailGroup,dc=pcihl,dc=com", "cn=Manager,dc=pcihl,dc=com", "secret", AuthenticationTypes.ServerBind)            Dim newLstEntry As Direct...

Adding values to a parameter that can take multiple values
If I have a Select statement like this in my C# code: Select * From foods Where foodgroup In (@foodgroup) And I want @foodgroup to have these values ... "meat", "dairy", fruit", what is the correct way to add the parameter? I tried meat, dairy, fruit 'meat', 'dairy', 'fruit' but neither worked. Is this possible? Please search these forums. This question has come up probably 10 times in the last few weeks. ***********************Dinakar NethiLife is short. Enjoy it.*********************** I tried a search and couldn't find anythi...

Using specific values from multi-valued attributes via LDAP?
I understand how to inject LDAP attribute data in to the authentication process via the form fill, but is there a way to select a specific value from a multivalued attribute? Say for example that I have an attribute called "myPasswords" that has multiple string values specifying a URL and a stored password. I'd need to be able to search for the value needed for the URL I'm authenticating to, then parse out the password section of that string and inject it in to the "password" box in the form. Possible? Not possible? ---------------------------------...

IDM rule: Adding multi-valued attribute values to an e-mail
IDM Gurus, I need some help with a rule I'm working on which will do the following: Query a user for groupmemberships Query that list of groups and grab CN and description values Add that list of CN and description values to an e-mail and SEND! I am as far as grabbing the groupMem values and setting a local variable but since it's multivalued, the rule only adds the 1st groupMem and prints it to the e-mail. Thinking I need a "for-each" rule or something along those lines, maybe XPATH, not sure, need some guidance please! I am running IDM 3.6.1. Regards,...

Multi-valued attribute to single attribute conversion
Afternoon Everyone! I have been trying to use the default rule in the AD driver to strip multi-valued attributes but for a modify operation but without any luck. I made a copy and put it in the Command Transformation. Would someone please give me asome pinters. I keep getting LDap Error 21, Invalid syntax. Error in attribute conversion operation. Here is the rule I am attempting using: <rule> <description>Convert multi-valued Telephone to single value</description> <conditions> <and> <if-operation op="equal">modify<...

Multiple attribute value
C#, web form, VS 2005.  Thank you in advance for reading/helping.Working with XML returned from a web service,  have some nodes that have the same name but different attribute values. Ex.<ReceivedRecords pk=""/><ReceivedRecords pk="1234.56"/><ReceivedRecords pk="789.00"/>I'm setting the value of the XML to a text box using xPath...here is the code://Grab value of returned XML at this location.XmlNodeList xmn30 = mydoc.SelectNodes("/Envelope/Body/Response/Contract/ReceivedRecords/@pk");//Output the results to a text boxtxtReceivedRecords.Text = (xmn30[0].InnerText)...

LDAP Attribute Values
Hi everyone,Is it possible to have dynamic/virtual attribute values for the LDAP owner attribute.  For example, if I have an owner attribute value set for an OU (organizational unit), can all users in that OU have that same owner attribute value dynamically assigned to them?Thanks. I am not sure what you mean.  Are you asking is there an AD supported way to infer that objects in an OU belong to the same owner of the OU?  Not really is the answer.  There are things like security ownership and things like 'managedBy' attribute that can show the 'owner' of an...

Adding LDAP attribute
How would I add an "dialupAccess" attribute to a user LDAP profile? Using Schema Manager, for example? -- Peter eDirectory Rules! ...

Mutli-valued attribute to multi-valued attribute
We want to synchronize a multi-valued attribute (created by our own) to a multi-valued attribute in the other edirectory store. But when we are adding attributes we only have the changed values. The previous one is lost. When deleting one value in the Identity Vault then it removes the attribute from the object. Any ideas ? > We want to synchronize a multi-valued attribute (created by our own) to a > multi-valued attribute in the other edirectory store. But when we are > adding attributes we only have the changed values. The previous one is > lost. When deleting ...

LDAP attribute Map / LIst / extend the LDAP attributes
we are use ladp on netware 65, is there a list of the LDAP attributes avaliable that are used for eDirectory 8.7? is it possible to create a ldap attribute that contains more that one edirectory attribute content and extend it with a static variable? any ideas HELGE -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Most eDirectory attributes are available natively by their name (minus spaces and special characters). For example fullname works to retrieve the 'Full Name' and givenname works for 'Given Name' and sasloginconfiguration works for 'SAS:...

One attribute value to two attributes/ values in eDir
Collective, I have a very interesting issue. I have the need to break one attribute that is in AD (ADval1) to two attributes in eDir (attrval1 and attrval2) . Basically what I want to do is take ADval1 and break that data into the two other attributes, attrval1 and attrval2. The attribute in AD looks like this: AD attribute value data 1 | value data 2 In eDir it looks like this: eDir attribute 1 vlaue data 1 eDir attribute 2 value data 2 I don't know if that's clear, when it was explained to me it was a white board. Has anyone tried this or have any id...

Adding attribute and value by LDIF
Hi Guys, I have found an issue with some user accounts in the tree. It seems as though the first users who were here 10+ years ago are missing a UniqueID attribute. Not sure how that happened, but to rectify it, I am going to use an LDIF to import the data. I can't seem to get the syntax right, it keeps telling me: "Record: 1, no attributes to change/add, dn:" I started off with this syntax: version: 1 dn: cn=abelad,ou=Membership,O=ORG changetype: add UniqueID: abelad Which failed. I then tried a couple of variations, which didn't fix the error. My ...

Adding records with multiple values
Hello, This is my issue, I am inserting records in a Access db.  After I insert the new record, I am retrieving the new inserted record unique ID and inserting it along with another value from the new record into a different table in the same database.  The new record is going to have a field that contains multiple values.  I don't know if I stated that correctly but here is an example.  I have a form that a user inserts a new customers info.  Among the pieces of information is, what products is the customer associated with.  More than likely he will be assoc...

I cannot list multiple values for the same attribute
--00504502e1b31c762a04aa3cd03d Content-Type: text/plain; charset=ISO-8859-1 Hi everyone, I am new to perl-ldap and like it very much, however I have a problem I cannot solve by myself (or using google). I have some attributes with multiple values in the same entry, such as: description: abc description: def description: ghi .... I perform a search using a base & filter, then try to list all attributes and their values in a foreach loop: foreach my $entry ($searchResults->entries) { foreach my $attr ($entry->attributes) { for ($attr) { if (/^...

Web resources about - Adding an attribute with multiple values. - perl.ldap

Attribute - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Template:Attributes of God - Wikipedia, the free encyclopedia
Language: English Română Home Random Template:Attributes of God Part of a series on the Attributes of God Aseity Eternity Graciousness Holiness ...

Six Attributes Of The Perfect Facebook Page Administrator
So, here’s the thing: In many ways, hiring a Facebook page administrator is akin to hiring a poster child for your brand. This trusted manager ...

PANDA: Pose Aligned Networks for Deep Attribute Modeling - Facebook
We propose a method for inferring human attributes (such as gender, hair style, clothes style, expression, action) from images of people under ...

Facebook announces data partnerships to help advertisers target users by offline purchases and attributes ...
... will anonymously match data from consumer loyalty programs with user profiles in order to target ads by offline purchase habits and other attributes. ...

New Study Attributes Rapid Ageing Mainly To Environment Factors
New study explains why some people age faster than others.

Should I use the nofollow attribute on internal links? - YouTube
Regarding "nofollow" on internal links: Does it hurt? Does it help? I read different comments from Matt on this matter over time. What's the ...

Justin Trudeau attributes abortion stance to father's example
Liberal Leader Justin Trudeau says he is following an example set by his famous father when it comes to his position on election candidates and ...

Obama attributes western U.S. wildfires to climate change
... that has burned nearly 400 square miles in the north-central part of Washington state, along with blazes in other Western areas, can be attributed ...

Fifty Shades Of Grey Baby Births: Windsor Hospital Sees Spike In Births, Attribute Book
A significant spike in baby births at a hospital in Windsor, Ontario, has been attributed to the book Fifty Shades of Grey, which has become ...

Resources last updated: 1/16/2016 6:41:28 PM