Lotus Notes - UniversalID


  • Can anyone tell me if it's possible to access the UniversalID field of a person document in the Lotus Notes MA?  I can't seem to find it.  Since it's one of the few things guaranteed to be unique and stable in Notes (so I'm told), it would seem sensible for it to be available.
    Tuesday, January 29, 2008 4:08 PM


  •  SSG31415926 wrote:

    Does anyone know if UniversalID is accessible to us in ILM code extensions?

    Although the ID is used internally as the anchor it is not exposed as an attribute you can get either by CSEntry["attribName"] nor by CSentry.DN



    Friday, June 20, 2008 6:24 PM

All replies

  • Only the default Lotus Notes schema is visible by default - any other attributes that may have been added you will need to manually add through the MA interface.  I don't have a Notes MA handy, but there is way to enter in the attributes LDAP attribute names.  Once you've done this you'll need to do a Full Import.


    Wednesday, January 30, 2008 12:07 AM
  • The UniversalID is a property on the person document in the Notes database rather than an item property - it's not something added to the schema. 


    The difference can be seen in code (using Lotus Domino Objects and Interop).  UniversalID is a document property:

    Code Snippet


    and FirstName is an item property:

    Code Snippet

    if (_notesDocument.HasItem("FirstName"))


    //Note: GetItemValue always returns a valueArray - use this when you know it's single-valued

    string attributeValue;



    object[] attVals = (object[])_notesDocument.GetItemValue("FirstName");

    attributeValue = attVals[0].ToString();




    where _notesDocument is:

    Code Snippet

    private Domino.NotesDocument _notesDocument;


    So I don't think I can add it that way.
    Wednesday, January 30, 2008 10:55 AM
  • Shouldn't the distinguished name in the Notes Address Book (NAB) be unique?  If you are getting a duplicate object error on your Notes MA import then either confirm that you do not have multiple person documents for the same people in the address book or make sure that they are named correctly.  For instance you should not have multiple John Smith's if they are truly unique individuals.  In this case you may need to update the people in question with a middle intial to create uniqueness.


    Tha being said it is possible to access the document unique id on your part but I would not recommend this. You should instead clean up the NAB and this should resolve your problem.  If you still want to go down the path of accessing the document unique id you would need to add a field to the person document in the NAB and compute the document id.  You would then need to update the Notes MA schema with the new field.  Chances are your Notes Admin will not let you do this! 

    Wednesday, January 30, 2008 3:01 PM
  • As far as I can tell, Notes doesn't really have a distinguishedName.  There's FullName which can appear like an LDAP dn but it's a multi-valued attribute and people here have > 1 if they've changed their name. 


    It's not the case that I'm dealing with duplicates.  What I'm trying to do is leave breadcrumbs.  I need to join manually a bunch of Notes IDs to AD IDs.  The users aren't on our personnel system, so the normal join rules don't apply.  I need a unique ID to stuff into AD so that I can rejoin the users in the case of having to rebuild the system.  I have control over AD but not Notes so I can add breadcrumbs to my AD users and some unique ID from Notes seemed to be the sensible approach.  UniversalID seems to be the only guaranteed unique field in Notes, which is why I wanted to use it.


    Wednesday, January 30, 2008 3:26 PM
  • Hmmm, in that instance is there some sort of secondary key that you could use?  We use the employee id as the primary key across our systems to solve this problem.  For instance, our AD users logon to the network with their employee id.  Their Notes record also has the employee id filled out as well to allow key matches in ILM.  I know that you said these users are not in your personnel system so perhaps this approach would not work but you get the idea. 


    An alternative might be to use the internet address field in Notes or some other unique attribute in your organizaton as your key .  This address should be unique in the Notes system BUT it could change as we all know.  Another thought that I have is to find an unused field in the person document which is also used by the Notes MA, such as employee id, and update that with the universal id.  That may solve the problem as well without having to update the NAB design and the Notes MA schema.

    Wednesday, January 30, 2008 4:47 PM
  • We use employeeID for users that are in the personnel system - as you guessed this won't work for these users.


    I think your last suggestion is probably the best, so far.  Thanks.

    Wednesday, January 30, 2008 6:06 PM
  • I think your two problems are related - the missing-dn problem is likely showing up as a duplicate.  If you have null Fullnames these will show up as duplicate records in the connectorspace (MIIS tries to escape the NULL so it may show up as '\'). 


    As Scott suggested, you need to have these records removed or corrected - the consequence of not doing this means you'll never get a clean Full Import and therefore two things will happen:

    1. An error free Full Import is required for record obsoletion so invalid records will never be removed
    2. You will never be able to process a Delta Import from this NAB without a clean Full Import


    Thursday, January 31, 2008 3:18 PM
  • I knew it was a good idea to get rid of errors but I didn't know why, so thanks for clarifying that.


    I've checked the connector space for Import Errors - there are 15.  I've changed the display to show objectGUID and none of them matches the UNID shown in the <missing-dn> Error details message.  What does the UNID represent?  How can I track this back to the problem object in Notes?

    Sunday, February 03, 2008 11:05 AM
  • UNID=Universal ID in Notes which the 32 character unique id for a given Notes document in a database.  You can find the document in question with the Notes method GetDocumentByUNID.  Your Notes Admin/Developer may be able to help out.



    Tuesday, February 05, 2008 6:13 PM
  • Sorted.  Wouldn't have done it without you, Scott.  Thanks.


    I had assumed that it was the Notes UniversalID and had written a bit of code to check but to no avail.  I tried every one of the rejected IDs (which would've been so much easier if you could copy the string from the dialog box - why, oh why, oh why, etc.) and they weren't found.  You telling me it was the UniversalID made me look at it again.  So, then I pasted them into Notepad and played around with them alongside ones that worked and I noticed similar strings in different places.  Anyway, I guess it's about high-order bytes and low-order bytes or something because shuffling the 'bytes' around works which I did with this code:


    StringBuilder sb = new StringBuilder();

    sb.Append(unid.Substring(8, 8));

    sb.Append(unid.Substring(0, 8));

    sb.Append(unid.Substring(24, 8));

    sb.Append(unid.Substring(16, 8));

    string searchUNID = sb.ToString();


    and then using GetDocumentByUNID(searchUNID).  Hurrah!


    Thanks everyone for your help.

    Tuesday, February 05, 2008 7:03 PM
  • Just realised that this was actually the answer to another thread, so I've copied it over there.  The original question was about using UniversalID inside ILM.  Now we know, categorically, that ILM knows about UniversalID so we're part-way there. 


    Does anyone know if UniversalID is accessible to us in ILM code extensions?


    Tuesday, February 05, 2008 8:22 PM
  •  SSG31415926 wrote:

    Does anyone know if UniversalID is accessible to us in ILM code extensions?

    Although the ID is used internally as the anchor it is not exposed as an attribute you can get either by CSEntry["attribName"] nor by CSentry.DN



    Friday, June 20, 2008 6:24 PM