Moving mail users from one server to another and updating the location document can be a hassle. We developed a
'form' that looks like a memo that can be sent to those individuals. It may contain a bland message, or an explanation of the process. Regardless of the message, when the user opens the email, a LotusScript is activated that edits and updates their location document.
We also perform some housekeeping on the location documents by removing everything but Office and Island. (This reduces accidentally going home on desktop computers.) We set the Proxy to 0.0.0.0:80 per a prior tech tip and make sure their e-mail addresses are computed correctly. Finally, we call a sub SendMail2 that notifies the Admin department that this user has changed their location document, the replica on the original server may be deleted and the server NAB changed. We toyed with automating the server NAB update, but elected to perform this manually.
Code: The UpdateLocation script is called on PostOpen. Sub UpdateLocation Dim s As New NotesSession Dim db As NotesDatabase Dim view As notesview Dim NameView As Notesview Dim doc As notesdocument Dim NameDoc As Notesdocument Dim user As String user = Cstr(s.CommonUserName) Set db = s.GetDatabase("", "names.nsf") Set NamesDB = s.GetDatabase("MailServer", "names.nsf") Set NameView = NamesDB.GetView("($VIMPeopleByFirstName)") If Not Nameview Is Nothing Then Set NameDoc = NameView.GetDocumentByKey(user) If Not NameDoc Is Nothing Then email = NameDoc.InternetAddress(0) End If End If Set view = db.GetView("Locations") If Not view Is Nothing Then Set doc = view.GetDocumentByKey("Office") If Not doc Is Nothing Then doc.MailServer = "MailServer2" doc.DefaultPassthruServer = "MailServer2" doc.CatalogServer = "MailServer2" doc.DirectoryServer = "MailServer2" doc.SametimeServer = "" doc.LocalAdmin = "NotesAdmin" doc.Proxy_HTTP = "0.0.0.0:80" If email <> "" Then doc.ImailAddress = email End If Call doc.save(True,True) Call SendMail2 End If Set doc = view.GetDocumentByKey("Home (Network Dialup)") If Not doc Is Nothing Then Call doc.Delete(True) End If Set doc = view.GetDocumentByKey("Home (Notes Direct Dialup)") If Not doc Is Nothing Then Call doc.Delete(True) End If Set doc = view.GetDocumentByKey("Travel (Notes Direct Dialup)") If Not doc Is Nothing Then Call doc.Delete(True) End If End If End Sub Sub SendMail2 Dim session As New NotesSession Dim dbMail As NotesDatabase Set dbMail = New NotesDatabase( "", "" ) Call dbMail.OpenMail Dim rtfBody As NotesRichTextItem Dim docMail As New Notesdocument(dbMail) Dim user As String user = Cstr(session.CommonUserName) docMail.Form = "Memo" docMail.Subject = "Updated Location to MailServer2" docMail.SendTo = "Admin" Set rtfBody = New NotesRichTextItem( docMail, "Body" ) Call rtfBody.AppendText ( "Updated Location to Dommail 2 for " ) Call rtfBody.AddNewLine( 2 ) Call rtfBody.AppendText(user) Call rtfBody.AddNewLine( 2 ) ' On Error Goto ErrorMail Call docMail.Send(False) Exit Sub EndProcess: End Sub
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Wade Gilliland. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.