Changing Domino servers

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 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 = 
 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 = ""
   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
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.

This was first published in February 2005

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.