0
votes

How do I do that? I'm trying NotesAdministrationProcess but some lack example in the help file. Searching the web is difficult since these method is seldom documented. Currently I'm using RenameNotesUser to rename the user but the changes only happen when I run 'tell adminp process new' on the server. How do I automate the the rename after sending the rename request?

Also I've no luck with changing the user's OU/Department. Which method should I use? Currently using RecertifyUser but it pops an error about certifier ID is not an ancestor of something. For example, I want to move a user from Technical department to Sales Department (John/Technical/ACME to John/Sales/ACME). Recertifying John manually in Domino Administrator using the sales ID works fine. I also want the change of user's OU to take effect immediately without telling Domino Console to process it.

The above 2 process don't have to run at the same time because a user couldn't have name and OU change at the same time. Below is the test code/agent that I use (I'll comment the rename code if I want to run the recertify code and vice versa):

Dim s As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView, doc As NotesDocument
Dim adminp As NotesAdministrationProcess
Dim svr$, path$, cert$, pwd$, staffid$, newlastname$

svr="" 'server1/ACME
path="" 'names.nsf
cert="" 'for rename(C:\tech.id), for recertify(C:\sales.id)
pwd="" 'for rename(tech), for recertify(sales)
staffid="" 'A0001(John's ID)
newlastname="" 'James

Set db=s.Getdatabase(svr, path, False)
Set adminp=s.Createadministrationprocess(svr)
adminp.Certifierfile=cert
adminp.Certifierpassword=pwd

Set vw=db.Getview("People\by Staff Number")
Set doc=vw.Getdocumentbykey(staffid, True)

'for rename. our company only use the last name as name
Call adminp.Renamenotesuser(doc.FullName(0), newlastname)

'for change ou
Call adminp.Recertifyuser(doc.FullName(0))
1

1 Answers

1
votes

I found 2 links that may help.

http://xprentice.gbs.com/A55BAC/keithstric.nsf/default.xsp?documentId=23303E4527F3A89B8525793B0061CB37

and

http://www-10.lotus.com/ldd/nd85forum.nsf/dba3ca7e515d55ff85256a0700727b35/07fc34e0ad09cea0852578b0003dad49?OpenDocument

The person in the 2nd link did a move in hierarchy and a rename. They apparently got the same error you did at first.

MoveUserInHierarchyRequest MoveUserInHierarchyComplete RenameNotesUser

Hope this helps.