Solved

Lotus Notes Agent

Posted on 2000-04-25
1
420 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now