Solved

Lotus Notes Agent

Posted on 2000-04-25
1
431 Views
Last Modified: 2013-12-18
Hi

I have Lotus Notes ersion 5.

I have 500 users that have internetpassword set, everyone to notes. When we place a server accesible from the internet a want to change password.

Can anyone give me a Lotus Script that change password in names.nsf, mail the password to the user and write it to a file together with the users name.

The password must be a least 8 character with 3 digits, i e hut765kl or something like that.
0
Comment
Question by:seko22an
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 300 total points
ID: 2749686
Here is some code I wrote a while ago to do basically the same as you are asking for....

You will need to change the ServerName and passfile constants to the name of your server and the path to the file you want to output...  

this is what the code does

- gets all of the people in the NAB
- generates a random 8 digit alpha only password for them
- encrypt the password and writes it to their person document in the httppassword field
- writes their name and the new password to the passfile
- sends them an email with there new password..

You probably will need to change the body of the memo they get sent.. Just edit the line that starts with memoDoc.body to do this...

I have to give credit for the password function to someone else but I have forgotten where I got it from !!!

Simply copy all of the code into an agent or an action button and run it..

Have fun !!

' CODE STARTS

Function CreateAPw(iNumChars As Integer) As String
     
     Dim x As Integer
     Dim newPw As String
     Dim pwChar As String
     
     Randomize
     
     pwChar = ""
     newPw = ""
     For x = 1 To iNumChars
          pwChar = GetAChar()
          newPw = newPw & pwChar
     Next
     
     CreateAPw = newPw
     
     
End Function

Function GetAChar As String
     
     Dim num As Single
     Dim done As Variant
     
     done = False
     
     Do Until Done
          num = Rnd 'Generate a number between 0 and 1
          num = num * (10 ^2) 'Make the number 2 digits
          If (Round(num, 0) >=10 And Round(num, 0) <= 12) Then 'If the number is between 10 and 12 then make it three digits. We want to capture the characters between 100 And 122
               num = num * 10 'Make the number three digits
          End If
          num = Round(num, 0) 'Make the number a whole number
          If (num >= 65 And num <=90) Or (num >= 97 And num <= 122) Then 'Ensure  that it is a alpha character
               GetAChar = Chr$(num) '
               done = True
          End If
     Loop
End Function

     Dim Sess As New NotesSession()
     Dim fileNum As Integer
     Dim NAB As NotesDatabase
     Dim ThisDb As NotesDatabase
     Dim PersonDoc,MemoDoc As NotesDocument
     Dim PColl As NotesDocumentCollection
     Dim Search,Password As String
     Dim i As Long
     Dim Eval As Variant
     
     Const ServerName="KCentral/Family Services"
     Const PassFile = "c:\temp\passwd.txt"
     
     Set ThisDb = Sess.CurrentDatabase
     Set NAB = New NotesDatabase(ServerName,"names.nsf")
     
     Search = "Form=""Person"""
     
     fileNum% = Freefile()
     Open PassFile For Output As fileNum%
     
    ' Do the search for all the users in the NAB
     
     Set PColl = NAB.Search(Search,Nothing,0)
     
     For i = 1 To PColl.Count
         
          Set PersonDoc = Pcoll.getnthdocument(i)
          Randomize(i)
          Password = CreateAPw(8)
         
          ' Write the password to the file
          Print #fileNum%, PersonDoc.FullName(0) + "," + Password
          Print "Creating Password for " + PersonDoc.FullName(0)
         
          ' Now Encrypt the password and write it to the NAB
         
          Eval = Evaluate("@Password(""" + Password +""")")
         
          PersonDoc.HttpPassword = Eval(0)
          Call PersonDoc.Save(True,False)
          Set MemoDoc = New NotesDocument(ThisDB)
          MemoDoc.Form="Memo"
          MemoDoc.Subject = "You new Notes Web password"
          MemoDoc.Body = "Your new Notes web password is " + Password + ". Please keep it a secret"
          Call MemoDoc.Send(False,PersonDoc.FullName(0))
         
     Next i
     
     Close fileNum%
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question