Home > Domino Tips > Developer > LotusScript > Changing Domino servers
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

Changing Domino servers


Wade Gilliland
02.03.2005
Rating: -4.23- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
LotusScript
How to clear a Lotus Notes local cache with LotusScript
Create a non-specified date picker with LotusScript code
LotusScript accesses clipboard to view copied Notes documents
LotusScript action button manages Lotus Notes mail files
LotusScript sorts a Lotus Notes document collection
Display Lotus Notes user group membership details in a tree view
Alternate version of @Command forwards subform via LotusScript
Process large arrays in Notes forms without undue coding or testing
How to use LotusScript to modify a Lotus Notes view selection
Display a custom message box using a LotusScript-generated button

LotusScript
How to clear a Lotus Notes local cache with LotusScript
Customize the principal field of outgoing email messages
Create a non-specified date picker with LotusScript code
Resolve Notes 8 migration error: 'Database has not been opened yet'
LotusScript accesses clipboard to view copied Notes documents
LotusScript action button manages Lotus Notes mail files
LotusScript sorts a Lotus Notes document collection
Display Lotus Notes user group membership details in a tree view
Alternate version of @Command forwards subform via LotusScript
Process large arrays in Notes forms without undue coding or testing

Lotus Notes Domino Deployment and Migration Advice
How to upgrade to Lotus Notes 8 and retain Lotus Notes 7
Resolve Notes 8 migration error: 'Database has not been opened yet'
Understanding a Lotus Notes Smart Upgrade rollout
How to export data from a Lotus Notes database to a CSV file
How to install Lotus Notes on Linux CentOS-4
How to install Lotus Domino Server on SUSE Linux
How to perform an in-place upgrade of Lotus Domino server hardware
Moving a remote user mail database to new Lotus Domino server
Top 10 Notes/Domino administration tips of 2006
How and why to change replica IDs during a Lotus Notes Domino upgrade

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts