locked
update preperty with encoded format RRS feed

  • Question

  • User-737517480 posted

    Hi all, I have a string that need to update to a directoryentry's property with encoded format.  (the ldif file should be like miautoreplytext::)

    How can I do so?  just use the add method and it doesn't work.  any advice 

    miautoreplytext::
    RnJvbTogIlBDSSBDdXN0b21lciBTZXJ2aWNlcyIgPGNzQHBjaWhsLmNvbT4NClN1YmplY3Q6ID9CSUc1P0I/VG05MGFXTmxJRzltSUhKbGMybG5ibUYwYVc5dUlHOW1JSGx2ZFhJPT89ID0/QklHNT9CP0lHbHVjM1Z5WVc1alpTQmpiMjV6ZFd4MFlXNTBJS3RQd0VuRlZiRGR3dmZDdnJOeHFyND0/PQ0KQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDhiaXQNCg0KPCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFsLy9FTiI+DQo8aHRtbD4NCjxoZWFkPg0KICA8bWV0YSBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1VVEYtOCIgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIj4NCjwvaGVhZD4NCjxib2R5IGJnY29sb3I9IiNmZmZmZmYiIHRleHQ9IiMwMDAwMDAiPg0KPGZvbnQgc2l6ZT0iMyI+PHU+Tm90aWNlIG9mIHJlc2lnbmF0aW9uIG9mIHlvdXIgaW5zdXJhbmNlIGNvbnN1bHRhbnQ8L3U+PC9mb250Pg0KPGJyPg0KPGJyPg0KPGZvbnQgc2l6ZT0iMyI+RGVhciBDdXN0b21lcnMsPC9mb250Pg0KPGJyPg0KPGZvbnQgc2l6ZT0iMyI+V2UgcmVncmV0IHRvIGluZm9ybSB5b3UgdGhhdCB5b3VyIGluc3VyYW5jZQ0KY29uc3VsdGFudCBoYXMgcmVjZW50bHkgcmVzaWduZWQgZnJvbSBvdXIgY29tcGFueS4gIFNob3VsZCB0aGVyZSBiZSBhbnkNCnF1ZXJpZXMsIHBsZWFzZSBkbyBub3QgaGVzaXRhdGUgdG8gY29udGFjdCBvdXIgQ3VzdG9tZXIgQ2FyZSBDZW50cmUgYXQNClRlbCBOby4gOjI4NjYtODg5OC4gIFdlIGFyZSBhbHdheXMgcGxlYXNlZCB0byBiZSBvZiB5b3VyIHNlcnZpY2UuPC9mb250Pg0KPGJyPg0KPGJyPg0KPGZvbnQgc2l6ZT0iMyI+PHU+5L+d6Zqq6aGn5ZWP6Zui6IG36YCa55+lPC91PjwvZm9udD4NCjxicj4NCjxicj4NCjxmb250IHNpemU9IjMiPuimquaEm+eahOWuouaItu+8mjwvZm9udD4NCjxicj4NCjxmb250IHNpemU9IjMiPueUseaWvOaCqOeahOS/nemaqumhp+WVj+W3suaWvOi/keaXpei+reiBt++8jOWmguacieS7u+S9leafpeipou+8jOatoei/juiHtOmbuzogMjg2Ni04ODk4DQroiIfmnKzlhazlj7jnmoTpoaflrqLmnI3li5nkuK3lv4Poga/ntaHvvIzmiJHlgJHmqILmhI/ngrrmgqjmnI3li5njgIIgPC9mb250Pg0KPGJyPg0KPGJyPg0KQ3VzdG9tZXIgU2VydmljZXMNCjxicj4NClBhY2lmaWMgQ2VudHVyeSBJbnN1cmFuY2UgQ29tcGFueSBMaW1pdGVkDQo8YnI+DQo8YSBjbGFzcz0ibW96LXR4dC1saW5rLWZyZWV0ZXh0IiBocmVmPSJodHRwOi8vd3d3LnBjaWhsLmNvbSI+aHR0cDovL3d3dy5wY2lobC5jb208L2E+DQo8L2JvZHk+DQo8L2h0bWw+
     

    Monday, August 28, 2006 10:50 PM

All replies

  • User-737517480 posted

    I tried the following codes but still no luck.  anyone can help?[:'(] 

    Dim sText As String sText = "Testing Script"

    Dim ByteArray As Byte()

    Dim oEncode As New System.Text.UnicodeEncoding()

    ByteArray = oEncode.GetBytes(sText)

    User.Properties("miAutoreplyText").Add(System.Convert.ToBase64String(ByteArray, 0, ByteArray.Length))

    Thursday, August 31, 2006 10:07 PM
  • User1297008538 posted

    Are you calling User.CommitChanges() when you're done?

     

    Sunday, September 3, 2006 6:38 PM
  • User-737517480 posted

    Are you calling User.CommitChanges() when you're done?

     

    of course, the problem is that i stored the values but the in a encoded way.  With export an LDIF file, it will display autoreplytext: (already encoded text) rather than autoreplytext:: (encoded text)
    Sunday, September 3, 2006 8:36 PM
  • User1354132231 posted
    What is the format of the attribute (forget LDIF here for a moment)?  Is this a custom attribute?
    Monday, September 4, 2006 1:41 PM
  • User-737517480 posted

    What is the format of the attribute (forget LDIF here for a moment)?  Is this a custom attribute?

     

    the attribute is provied by company of our web mail system

     
    # The miAutoreplyText attribute is a single-valued attribute that
    # has the body of the message that is sent out if the user has
    # automatic replies turned on.
    #
    attributeTypes: ( 1.3.6.1.4.1.3246.249.4.1.5 NAME 'miAutoreplyText'
            EQUALITY caseIgnoreMatch
            SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256}
            SINGLE-VALUE
        X-ORIGIN 'Mirapoint Messaging Server'
        )
     

    Monday, September 4, 2006 8:40 PM
  • User-737517480 posted
    anyone help?
    Wednesday, September 27, 2006 9:08 PM
  • User1354132231 posted

    Sorry, I thought I replied to this earlier.  Looking at the syntax, there is nothing special about it.  It is your standard unicode, case-ignore-string.  When you put the Base64 string in this field - which should work without error- what are you seeing by the app?  I would assume you would actually see just the Base64 string again.  This seems to simple to ask, but have you just tried storing the string without encoding it first?  The LDIF file encodes unicode text in Base64 for the LDIF app, not the directory.

     

    Thursday, September 28, 2006 8:40 AM