Need script to send ID file of user to an address

I need to collect the ID file/password of 86 users on my domain because their public key doesn’t match the one in the NAB and it’s causing issues during recertifications… Some glitch occured a few years ago with the tool we’re using for recerts and we never corrected them. We now have the time to do it but I don’t know how other than by calling each user one by one (which could be quite tedious)… I can’t use a safe ID either because I need to import the correct ID file in the ID vault we’re using to overwrite the incorrect one in addition of correcting the public key in the NAB, so I need the full ID.

I would like to send the users a button to do the following:

  1. Get the location/name of the user’s active ID file from the notes.ini

  2. Prompt for ID file password in plain text

  3. Send the ID/password to a preset email address

I can do step 1-2 on my own, but for step 3… I’m a need some help… I don’t know where to start or what to use. I’ve looked at some methods but I can’t see to get the whole picture and don’t know what’s possible to do. Keep in mind that I’d like this to happen in the background when the user clicks on the button (avoid opening a new window).

Any help or pointers with code examples would be greatly appreciated.

Thanks!

Subject: Need script to send ID file of user to an address

All you need to do is create a memo document and attach the file you’ve found to it. This is code I just came up with off the top of my head, I haven’t tested it:

Dim session As New NotesSession

Dim db As NotesDatabase

Dim memo As NotesDocument

Dim body As NotesRichTextItem

Dim directory As String

Dim idfile As String

directory = session.GetEnvironmentString(“Directory”)

idfile = session.GetEnvironmentString(“KeyFilename”)

If Right$(directory, 1) <> "" Then

directory = directory & ""

End If

Set db = session.CurrentDatabase

Set memo = db.CreateDocument

Call doc.ReplaceItemValue(“Form”, “Memo”)

Call memo.ReplaceItemValue(“SendTo”, destination_address)

Set body = memo.CreateRichTextItem(“Body”)

Call body.EmbedObject(EMBED_ATTACHMENT, “”, directory & idfile)

Call memo.Send(True) 'assuming the Memo form is NOT in the destination database

Subject: RE: Need script to send ID file of user to an address

Thanks! I’ll give that a try and improvise for the rest. That should get me started!