Manage Learn to apply best practices and optimize your operations.

Easy Way To Take Care Of Client Changes For User Moves In R4

Button for Moving Users

Users moved from one server to another server have always been a bit of a
problem. This button and procedure has saved considerable time & help-desk

The button performs the following tasks:

1. Does a lookup of the mail server & mail file specified in the users person
2. Gets the replication id of the mail file from the users home server
3. Checks to see if a local replica copy of the mail file mail can be found or
if the database that script is being run from is local - if a database is found
the script adds the mail server to the acl as manager.
Note* When checking for a db by replica ID, is only looks under the note\data
directory is a person has replicated mail to another directory or drive
OpenByReplicaID will not find it, that is why the script also checks to see if
it current database that it is being run from is local.
4. The next portion updates the location document with the mail file and mail
server name (Thanks to Author: Christiaan Walker Title 4 Tip: Document
Adjuster )
5. The Final step is a pop-up dialog box that informs the user what has been
done. Helpful for troubleshooting.

I have combined this with the following procedure

Add ACL entry for new server to mailfiles being moved
Create replicas stubs of mailfiles
Pull mailfiles to new server
Tell replica quit on old server
Update NAB with changes (users & grouplist)
Pull address book to new server
Compose and send out messages to users (set your location to the old server -
that way the message is placed in their mail file)
Tell router quit on old server once messages have been delivered
Load replica & pull nab on old server
Load router on old server
Pull mail files from old server

The message that is sent out contains the following:

A button with the script

Instructions on how to switch replica - this way the unread marks stay the
same (file - replicaction - switch replica)

Instructions for replicating with the new server (only if they keep a local
Sub Click(Source As Button)
End Sub

Function UserLookup
Dim Session As New NotesSession
Dim NabDB As NotesDatabase 'Server that the lookup will be done on
Dim NabView As NotesView 'View from Nab
Dim NabDoc As NotesDocument 'Person Document in Nab
Dim NabLookup As String ' Variable to allow address book lookup server to
Dim FullUserID As New NotesName(session.UserName) 'Current users name
Dim AbbreviatedUserID As String 'Abbreviated users name
Dim MSV As Variant 'Mail Server Variant
Dim MFV As Variant 'Mail File Variant
NabLookup = "YourNABServer/ORG/Cert" 'Set the server to perform the lookup

AbbreviatedUserID = FullUserID.Abbreviated 'Abbreviate the users name -
used for the view lookup

Set NabDB = session.GetDatabase(NabLookup,"Names.nsf") 'Open Address book
Set NabView = NabDB.GetView("($Users)") 'Open View in Address book
Set NabDoc = NabView.GetDocumentByKey(AbbreviatedUserID) 'Open Person Doc
in address book
MSV = NabDoc.GetItemValue("MailServer") 'Get Mail Server from person doc
MFV = NabDoc.GetItemValue("MailFile") 'Get Mail File from person doc
MailServer = MSV(0) 'Convert MSV from Variant to String
MailFile = MFV(0) 'Conver MFV from Varaint to String





End Function

Function GetRepID

Dim REPSession As New NotesSession
Dim UserDB As NotesDatabase 'Users mail file

Set UserDB = REPSession.GetDatabase (MailServer,MailFile)
MailFileReplicaID = UserDB.ReplicaID

End Function

Function OpenMailFile
Dim OpenSession As New NotesSession
Dim UserLocalDB As New NotesDatabase ("","")
Dim UserLocalDB2 As NotesDatabase
Dim UserLocalACL As NotesACL
Dim UserLocalEntry As NotesACLEntry
Set UserLocalDB2 = OpenSession.CurrentDatabase

If UserLocalDB.OpenByReplicaID( "", MailFileReplicaID ) Then
'Call UserLocal.GrantAccess( MailServer, ACLLEVEL_MANAGER )
Set UserLocalACL = UserLocalDB.ACL
Elseif UserLocalDB2.Server = "" Then
Set UserLocalACL = UserLocalDB2.ACL
LocalMailFileFound = 0
Exit Function
End If

Set UserLocalEntry = New NotesACLEntry( UserLocalACL, MailServer ,
ACLLEVEL_Manager )
If ( UserLocalEntry.Level <> ACLLEVEL_Manager) Then
UserLocalEntry.Level = ACLLEVEL_Manager
End If
UserLocalEntry.CanDeleteDocuments = True
Call UserLocalACL.Save
LocalMailFileFound = 1

End Function

Function UpdateAllLocationDocuments
Dim session As New NotesSession
Dim LocalAddressBK As NotesDatabase 'Local Address Book
Dim LocalAddressBK_DocCollection As NotesDocumentCollection 'Doc
Collection of Location Docs
Dim LocalAddressBK_Doc As NotesDocument 'Current open document in Local
Address Book
Dim LocalAddressBK_MailServer As NotesItem 'Parameter to replace MailServer
Dim LocalAddressBK_MailFile As NotesItem ' Parameter to replace MailFile
Dim dateTime As New NotesDateTime ("1/1/1971")
Dim i As Integer

Set LocalAddressBK = session.GetDatabase ("", "names.nsf") 'Open Local
Address book if available
If LocalAddressBK Is Nothing Then
UpdateAllLocationDocuments = False
Exit Function
End If

searchFormula$ = "Form = ""Location"" "
Set LocalAddressBK_DocCollection = LocalAddressBK.Search(searchFormula$,
dateTime,0) 'Get List of Docs in Local Address Book

UpdateAllLocationDocuments = True
If LocalAddressBK_DocCollection.Count <> 0 Then
For i=1 To LocalAddressBK_DocCollection.Count
Set LocalAddressBK_Doc =
Set LocalAddressBK_MailServer

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...