ContactNoteID (NotesRegistration - LotusScript)

Represents the Note ID of an existing Person document to use when registering a user.

Defined in

NotesRegistration

Data type

String

Syntax

To get: string$ = notesRegistration.ContactNoteID

To set: notesRegistration.ContactNoteID = string$

Usage

Used to register users who have existing Person documents created by syncing Active Directory users into the Domino directory.

Notes applications can identify these documents as Active Directory contacts. The currently selected document must have a text item called "objectGUID" which represents the unique identifier for an Active Directory contact. It must also NOT have a value for the item "certificate" as this would indicate the document has already been registered. See the example.

Return value

The Get method returns a string. There is no return for the Set method

Example

Sub Initialize

    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim collection As NotesDocumentCollection
    Dim syncDoc As NotesDocument
    Set db = session.CurrentDatabase
    Set collection = db.UnprocessedDocuments
    Set syncDoc = collection.GetFirstDocument()
    If Not (syncDoc Is Nothing) then

        Dim reg As New NotesRegistration
        Dim noteid As String
        Dim firstName As String
        Dim lastName As String
        Dim certificate As String
        Dim objectGUID As String	

        noteid = syncDoc.NoteID

        firstName = syncDoc.firstName(0)
        lastName = syncDoc.lastName(0)
        certificate = syncDoc.certificate(0)
        objectGUID = syncDoc.objectGUID(0)
        
        If syncDoc.hasItem("objectGUID") Then                 Document must have objectGUID     
            If Not syncDoc.hasItem("certificate") Then        Document must not already be registered

                reg.ContactNoteID = noteid                    Set the Contact Note ID
                                                              Set the other registration properties
                reg.RegistrationServer = "ServerA/acme"
                reg.CreateMailDb = False
                reg.CertifierIDFile = "c:\server\ids\acme.id"
                reg.Expiration = Today + 1095
                reg.IDType = ID_HIERARCHICAL
                reg.MinPasswordLength = 5                      Password strength
                reg.IsNorthAmerican = True
                reg.OrgUnit = ""
                reg.RegistrationLog = "log.nsf"
                reg.UpdateAddressBook = True
                reg.StoreIDInAddressBook = True
                                                                Register the user
                Call reg.RegisterNewUser(lastName, _               Last name
                    "c:\server\ids\people\" & lastName & ".id", _  File to be created
                    "CN=ServerA/O=acme", _                         Mail server
                    firstName, _                                   First name
                    "", _                                          Middle initial
                    "acme", _                                      Certifier password
                    "", _                                          Location field
                    "", _                                          Comment field
                    "mail\" & lastName & ".nsf", _                 Mail file
                    "", _                                          Forwarding domain
                    "password", _                                  User password
                    NOTES_DESKTOP_CLIENT)                          User type

		End If
	 End If
    End if
End Sub