Updating Multiple Person Entries in Domino Directory

Hi, I am fairly new to Notes administration, so the solution to this may be simple. I have a file (txt and excel) with user First and Last names as well as different entries for their Comments field (for approx 750 users out of 3000+)

How do I update the Person details for all of the Names in the file?

I tested Importing a 1-2-3 file but that just added an extra Person to the Directory, it did not update a existing Person.

Unless it is possible to write an agent… Do while not EOF … match both First and last name and edit the comment field?

Any help would be greatly appreciated! Thank you in advance.

Subject: Updating Multiple Person Entries in Domino Directory

“I tested Importing a 1-2-3 file but that just added an extra Person to the Directory, it did not update a existing Person.”

You got that right! But you can set the comments field while importing users from a text file that is in the proprietary Lotus format; see the admin help document “Registering users from a text file” for this format; Comment is argument number 12. Since registering users from the Register Person dialog will allow you to choose whether you want to you to update any existing person document with a matching name or create a new one, this might be the way for you to go – except that it’s going to prompt you to choose 750 times! So you might prefer to just write an agent.

“Unless it is possible to write an agent… Do while not EOF … match both First and last name and edit the comment field?”

Sure. The key here is whether the first/lastname combos you have in your text file accurately match the names in the person documents, and if they’re unique firstname/lastname combos. If these things are true, then you can simply do something like this:

set db = %the NAB%

set v = db.getview(“($Users)”

'open text file for input

'do until eof

name = %firstname space lastname%

set doc = v.getdocumentbykey(name)

doc.comments = %comments%

'set any other person doc fields from your text file

if not doc.save(false, false) then

	'make a note of the failed save or loop back and save again or something

end if

loop

Note that you can attempt to avoid save conflicts by looping until the save is successful:

do until doc.save(false, false)

'empty loop or sleep(10) or something

loop

but without some sort of max limit test, you’re risking an endless or essentially-endless loop. Of course, on client-side code like this, that’s not necessarliy the end of the world.

Subject: Updating Multiple Person Entries in Domino Directory

I’d like to thank all of you that posted messages to this issue. It is much appreciated.I’ll get cracking on this and see if I can get it sorted.

Much thanks again.

Subject: Updating Multiple Person Entries in Domino Directory

Hi,

Yes you will need to write an agent to do this. You will probably want to use one of the hidden views for your lookup e.g. ($Users)

Just be careful when comparing the users based on First Name + Last. There may be duplicates in the Domino Directory and you can’t be guarenteed to find the right person using this key. e.g. you may have Joe Bloggs and Joe B Bloggs.

Regards

Ethann Castell

Caliton Innovations

www.caliton.com

Subject: Updating Multiple Person Entries in Domino Directory

A different approach …

If you can somehow devine each individual’s distinguished name, using the limited info you have (firstname and lastname), then an alternative is to transform your data to RFC 2849 (LDIF) format and run an ldapmodify command line tool (can be found on web).

Knowing that the Person doc’s Comments field is mapped to the LDAP description attribute (from looking at the LDAP server’s schema), you hack your text files (perl is well-suited for this) to something like:

dn: cn=Ken Lin, ou=Westford, o=IBM

changetype: modify

replace: description

description: My new description

You’d need to run the LDAP server and supply ldapmodify with the credentials of someone with write access to your directory. You can apply these skills to any other vendor’s LDAP server/directory as well! For more about Domino LDAP, google “Domino Directory FAQ”