Tip

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
calls.

The button performs the following tasks:

1. Does a lookup of the mail server & mail file specified in the users person
document
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
copy)
Sub Click(Source As Button)
UserLookup
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
change
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
on

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

GetRepID

OpenMailFile

UpdateAllLocationDocuments

FinalMessage

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
Else
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 =
LocalAddressBK_DocCollection.GetNthDocument(i)
Set LocalAddressBK_MailServer

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.