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 DirectoryEntry = de1.Children.Add("cn=List_RD", "mailGroup")
            newLstEntry.Properties("cn").Add("List_RD")
            newLstEntry.Properties("mailHost").Add("test.pcihl.com")
            newLstEntry.Properties("mail").Add("list_RD@test.pcihl.com")
            newLstEntry.Properties("mgrpAllowedDomain").Add("test.pcihl.com")
            newLstEntry.Properties("mgrpRFC822MailMember").Add("testuers1@test.pcihl.com")
            newLstEntry.Properties("mgrpRFC822MailMember").Add("testuers2@test.pcihl.com")  
            newLstEntry.CommitChanges()

0
yipchunyu
5/26/2006 5:59:49 AM
asp.net.active-directory-ldap 2291 articles. 0 followers. Follow

6 Replies
1400 Views

Similar Articles

[PageSpeed] 56

The attribute existed after you insert first,if you want to replace the value of the attribute.

you must check whether the value exists.

iI am'not  familiar with vb.net,

 Forgiving me  coding with c#,

hope this helps

 

static void SetProperty(DirectoryEntry de, string PropertyName, string PropertyValue)
  {
   if (PropertyValue != null)
   {
    if (de.Properties.Contains(PropertyName))
    {
     de.Properties[PropertyName][0] = PropertyValue;
    }
    else
    {
     de.Properties[PropertyName].Add(PropertyValue);
    }
   }
  }


stswordman
0
stswordman
5/26/2006 8:17:22 AM
stswordman:

The attribute existed after you insert first,if you want to replace the value of the attribute.

you must check whether the value exists.

iI am'not  familiar with vb.net,

 Forgiving me  coding with c#,

hope this helps

 

static void SetProperty(DirectoryEntry de, string PropertyName, string PropertyValue)
  {
   if (PropertyValue != null)
   {
    if (de.Properties.Contains(PropertyName))
    {
     de.Properties[PropertyName][0] = PropertyValue;
    }
    else
    {
     de.Properties[PropertyName].Add(PropertyValue);
    }
   }
  }



sorry, what is the difference between
  de.Properties[PropertyName][0] = PropertyValue;
 and
   de.Properties[PropertyName].Add(PropertyValue);
0
yipchunyu
5/26/2006 9:25:57 AM

if you have set the value of "X" attribute,and want to replace the value of the attribute,you can code this: 

de.Properties["X"][0] = PropertyValue.

 

And if the "X" attribute doesn't exist,you should write:

de.Properties["X"].Add(PropertyValue);

 


stswordman
0
stswordman
5/26/2006 2:03:50 PM
stswordman:

if you have set the value of "X" attribute,and want to replace the value of the attribute,you can code this: 

de.Properties["X"][0] = PropertyValue.

 

And if the "X" attribute doesn't exist,you should write:

de.Properties["X"].Add(PropertyValue);

 


but if i want to add multiple value (the the attribute existing).  Then, I should use sth like?

de.Properties["X"][1] = PropertyValue.?


-1
yipchunyu
5/29/2006 12:53:37 AM

only use

de.Properties["propertyName"].Add("values")

 

If it throw a exception ,the property  you want to set  maybe is not   multiple-value  property

Could you tell what is the property name?

you can try some mutiple-value property and set  some values

For example:  url,otherTelephone,otherHomePhone

they are a set of mutiple-value property of users

 

Regrads......

 


stswordman
0
stswordman
5/31/2006 12:31:27 AM

Thx stswordman for your response.

however, i think it should be a multiple-value property (as I can add it through a GUI).

anyway, the attribute is

attributetype ( 2.16.840.1.113730.3.1.30
      NAME 'mgrpRFC822MailMember'
      DESC 'RFC822 mail address of email only member of group'
      EQUALITY caseIgnoreIA5Match
      SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )

Any idea?

stswordman:

only use

de.Properties["propertyName"].Add("values")

 

If it throw a exception ,the property  you want to set  maybe is not   multiple-value  property

Could you tell what is the property name?

you can try some mutiple-value property and set  some values

For example:  url,otherTelephone,otherHomePhone

they are a set of mutiple-value property of users

 

Regrads......

 

0
yipchunyu
6/1/2006 3:06:04 AM
Reply:

Similar Artilces:

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<...

Matching each value out of multiple values to single column value
 Hi,  @whoposted in stored procedure holds value "agent  builder owner"  ( please note the space in between) My column  POSTED_BY  always holds one and only one value out of above 3.Example:       POSTED_BY  owneragent          etc... If  All / any of the value hold by  @whoposted matches with value of POSTED_BY column, i want to show that row in gridview.( Also, please note, str may hold different values depending on user selection. For example, it may ...

Error "Multiple-step operation generated errors. Check each status value setting datetime field value" with TADOQuery and TDateTime (Delphi XE2)
Hello all, I've created an application which should do some automated tasks. When I run the application normally (as admin on a Window Server 2008 R2 x64 + MSSQL Server 2008 R2) everything works just fine. But whe I run the application a a 'sceduled taks' (with a different Windows User account), I get the following error when I modify a datetime field of a SQL query and I try to post the record Multiple-step operation generated errors. Check each status value setting datetime field value This is what I do (not exact query...): procedure Edit(aConn: T...

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 ...

HostedActiveDirectory::GetProperties does not return multi-valued active directory values
 Hello.I would firstly like to say that this is one great forum for MPS questions and that this is my first question here (i was mostly a reader for now:)Even after some longer than usual searching i can not find solution for problem of getting ANY multi-valued active directory values by using HostedActiveDirectory::GetProperties web method. This is quite unfortunatelly. Because of this i have to cache some unnecessary meta data on my own SQL database which i would like to avoid as much as possible and work only with MPS.If i elaborate some more with example:1. I create distribution lis...

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? ---------------------------------...

If Not value or value then....
Hi all,I want to write a simple IF Not then statement in ASP.net 2.0 and I would like some help please.  If Not ntuser = "DOMAIN\ntuser" Or ntuser = "DOMAIN\ntuser2" Then Panel1.Visible = False End If Doesnt work, can you tell me where i'm going wrong please?many thanks.  The first place you're going wrong is in telling us it "doesn't work" without providing any details. JeffPlease: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. Use Not as stated below. It ...

LDAP Driver
Hi! I have a problem with a LDAP Driver. I want to add an attribute value of an object that I haven't mapped with eDirectory. on openLDAP Ex. node: gruppi - object : gruppo1 - attribute : member I want to add a new member of the object gruppo1 that isn't mapped. The trace is: 19:48:01 5B401BB0 Drvrs: PROVA_LDAP ST: Submitting document to subscriber shim: 19:48:01 5B401BB0 Drvrs: PROVA_LDAP ST: <nds dtdversion="3.0" ndsversion="8.x"> <source> <product version="3.0.10.20060630 ">DirXML</product> <con...

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...

Net::LDAP -> Active Directory password change attribute failure
Okay, even using the code chunk from "the FAQ"(tm), trying to have a user change their own password results in the error message: 0000052D: AtrErr: DSID-03190F00, #1: 0: 0000052D: DSID-03190F00, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 9005a (unicodePwd) from the $ldap->modify( changes=>{delect,add} ) operation. Have tried numerous methods of encoding the password unicode (which all end up the same result) as well as base64 encoding. Strangely, if I use a "replace" operation instead of changes=>{delect,add}, it is accepted (tho i g...

ICallbackEventHandler and passing multiple string values to server and receiving multiple values
Hello, I need some help with ICallbackEventHandler and was wondering if some experts can share their knowledge on this. Thanks in advance. I am retrieving results from a web service that returns xml nodes. In order to return XML nodes to client, I have converted xmlnodes into string (string concatenation and returned one string to the client). Is there a way to return may be xml or JSON or even a string array using ICallbackEventHandler. Here is my complete code. Imports net.ecubicle.www Imports System.Xml.LinqPartial Class driving_web_service Inherits System.Web.UI.PageImplements ICa...

RE: Net::LDAP -> Active Directory password change attribute failure
------_=_NextPart_001_01C621ED.C1F635D4 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We use a modify/replace on the dn to change the password. However, this = operation will only succed over LDAPS and not over LDAP. Here's a sub = that we use in our account maint 'system' to change AD passwords: =20 sub _setADPasswordForUser { my ($dn, $pass) =3D @_; my $name =3D "_setADPasswordForUser"; my ( $package, $filename, $line ) =3D caller;=20 debug("$name: entering with args @_"); ...

"Invalid File or Directory attributes value" Error when uploading custom module
I'm pretty new to DNN module building and have embarked on creating my own custom modules as private assemblies for DNN 2.1.2. I have my module all zipped up and upload it through the File Manager, but I get this error: Exception: System.ArgumentException: Invalid File or Directory attributes value. at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes) at DotNetNuke.Installer.PaDnnInstallerBase.CreateFile(String FullFileName, Byte[] Buffer) in \DNN\admin\PAUploader\PaDnnInstallerBase.vb:line 365 at DotNetNuke.Installer.PaDnnInstallerBase.CreateBinFile(PaFile File) i...

Single Value to Multi Value attribute
Hi all I have an attribute 'source', in my eDirectory dn: cn=schema changetype: modify add: attributeTypes attributeTypes: ( source-oid NAME 'source' DESC 'to capture the source where the user or group is pulled from' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) - I need to modify this attribute from Single valued to Multi-value attribute, - I also need to modify the name of this attribute from 'source' to 'uniqueSource' can any one please give me the exact syntax for the the above modifications ...

Pulling Values out Mulit-Valued Attribute
Scenario: I have a user that is given a new card, they lost the old one, with a value in it for to authinacate for access. The value is going from AD to eDirectory but in the process I have pull the old value out among other values and just replace the one value. At this point all I am trying to do is pull the values and put them in local variables. This is what I have so far. From the values it returns I just want what is in-between the >< product version="3.5.1.20070411 ">DirXML</product> <contact>Novell, Inc.</contact> </source>...

Query a multivalued attribute and store part of each value in a single valued string/attribute
Hello hello again, so I am trying to cook something again and obviously I am failing. I have a mutlivalued attribute in eDirectory and I need to store a part from each value into a single valued attribute. Example: Attribute A - value1: 001-I - value2: 002-D - value3: 003-M I need the I and the D and the M and store in a single valued attribute Attribute B -value: IDM I managed to query the destination user to get the attribute I want from the user ... WOHOO :-) Yet everythin after fails Here is what I cooked up: <actions> <do-set-local-variable n...

Clear all values / Remove attribute values
How can you remove all values for an attribute in an application? (LDAP-OID) If I use "do-clear-dest-attr-value" It wants a value to remove. I want do-clear-dest-attr-value(s) when I do not care what the attribute values are. THe situation is there is a flag in OID and we want to remove the all attribute values form the attribute based on a event in Edirectory. Thanks -jim do-clear-dest-attr-value is what you want - it does not require a value. -- Father Ramon Jim Willeke wrote: > How can you remove all values for an attribute in an application? >...

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...

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)...

Multiple values for multiple items insert using c#.net
Hello, I have an application that allows the user to insert multiple values all related to the same item that reside in multiple tables. example base information, style general details, parts of a style etc. a single table binds them all together using foreignkeyid's. This is kind of a slow process, because they might have to create a set of styles in different colors etc on the same day. say 15 items which are different only in color. Now, I' m having to design a form which will let them insert all 15 items at once.  I dont know how to show you the lay out I have?? My idea abo...

add multiple listbox value to add another list box
Hi forum Members, I want to add multiple list box value to another list box using a button click event how can i do that Any body help me on this problem Thanking You Subhakanta   You can do it using client-side techniques like this:http://www.codeproject.com/KB/webforms/DblPanePickList.aspx Or using server-side techniques like this:http://www.codeproject.com/KB/aspnet/ASPNET_ListBox.aspx Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! 1. <asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple...

Error: Parameter x value missing a value
Hi frens, I am new to SSRS 2005. I am getting an annoying error Parameter x value missing a value. while generating in the browser. the same report works fine in SSRS report manager.Error Sit: i have a web application where user selects 4 categories like plants,crops,products,regions(these categories are filled in list boxes).After selecting them, I am passing the list items in a list collection,storing in a session and passing it to report viewer page which opens in a new window.thing is when I select only one item under region category the report works fine,but if i select multiple values for region,it says the parameter 'sales_region'(report parameter) is missing a value.why does such error arise!funy thing is though I debug the reportvieer page i was not shown any exception,the error displays when it was about to show the report!!  Hi, you are forgetting the parmeter to get passed to ReportViewerReportParameter cityParameter = new ReportParameter("City", DropDownList1.SelectedValue); this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { cityParameter });You can sarch the articles on google. or how to pass parameter to reportViewerhttp://www.youtube.com/watch?v=sXJmRHgSAS8SatalajWatch The true story of internet ||Yet another forum |||I'm big fan of Open source flash chart for .net very very simple I n t e r v i e w T i p s hi fren,Actually i am sending parameters.the same code works wit other reports.As I s...

Multiple values not synchronized when setting the dest value
Hi, Based on the availability of MailActive attribute in Corporate Distribution Directory(CDD), I'm setting OtherRfc822Mailboxes attribute in phoenix directory. But the problem is OtherRfc822Mailboxes attribute is a multivalued attribute and it is having 2 values in CDD. but if use do-set- dest-attr-value it sets only 1 value in phoenix. Even I tried for-each loop as well. I didn't get any breakthrough. Would you please help me to resolve this problem? Vijay do-set-dest-attr-value removes all existing values, so if you want to end up with more than one value you n...

Passing QueryString Value into a HiddenField Value Attribute
Having trouble passing the value of a query string into the Value attribute of a HiddenField. Any assistance would be greatly appreciated:  <asp:HiddenField ID="NAME" runat="server" Value="querystringVALUE" />   Do it in the Page_Load :   <asp:HiddenField ID="NAME" runat="server" Value="querystringVALUE" />  NAME.value = request.querystring("myURLParameter") Intelligence is a burden.Jagdip Singh AjimalManchester (and yes, I am a Manchester United fan)...

Web resources about - add values to multiple-valued attribute error - asp.net.active-directory-ldap

Facebook Stock, Valued on a Multiple of Revenue vs. Google, Would Plunge How Far?
Facebook (FB), once touted as a $100 billion company, is now down to $41.5 billion in market cap. But that’s still way too high, according to ...

Building a business that will be valued at high multiples
I’m going to talk with the board of one of our portfolio companies today about the characteristics of highly valued businesses and what they ...

Resources last updated: 3/2/2016 8:16:47 PM