Solved

Lotus Notes Agent

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

910 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

21 Experts available now in Live!

Get 1:1 Help Now