Switch to user ID, change ID password in LotusScript

I use this code in LotusScript to go through shares on a server looking for user ID files. Once the ID files were found, I would run the code against them to gather information about the ID. I've also used the code in a Domain merge to run a list of IDs against a server to change a password and trigger the Adminp process.

Declare Function 
SECKFMChangePassword Lib 
(Byval IDFile$,Byval OldPassword$,
Byval NewPassword$)As Integer
Declare Function 
SECKFMSwitchToIDFile Lib 
(Byval IDFile$,Byval Password$,
Byval UserName$, Byval 
ReservedFlag&,Byval flag&)As Integer
Declare Function OSLoadString Lib 
(Byval hModule&, Byval Status%, 
Byval retBuffer$, Byval BufferLength%)
 As Integer

 Name As String
 Password As String
End Type

Function APICheckError(Error%) As String
 Dim s$, x%
 If Error% <> 0 Then
  s$ = Space$(254)
  x% = OSLoadString(0, Error%, s$, 254)          
  If x% = 0 Then
   s$ = "General Notes Error"
   s$ = Left$(s$,x%)
  End If          
  APICheckError= s$
 End If          
End Function

Sub APISwitchID(filepath$, 
passwordlist, id As ID_Info, s$)
 Dim Status%
 Dim Flag%
 Dim UserName As String * MAXUSERNAME
 ID.Password= "NA"
 Forall x In PasswordList       
  Print s & " Checking Password ......" 
& Pword$ ,filepath$
  If Status% =0 Then      
   Print Now " Change Password 
SUCCESS %lt" & IDFile$ & ">"    
'   Call  CreateIDDoc(filepath$,UserName,
   ID.Password= Cstr(x)
   Exit Forall
   Print "Error " & APICheckError(status%)
   Print" Change Password 
ERROR <" & IDFile$ & ">"
   Print" ERROR <" & 
APICheckError(status%)& ">"  
  End If 
 End Forall
 If Flag%=False Then
  Print Now & " ERROR Could 
Not Add file <" & IDFile$ & ">"    
 End If
End Sub

Function  APIChangePword(IDFile$, 
OldPword$, NewPword$)As Integer
 Dim Status% 
 If Status% =0 Then 
  Print"Change Password SUCCESS 
<" & IDFile$ & ">"
  Print"Change Password ERROR <" 
& IDFile$ & ">"
  Print"ERROR <" & APICheckError
(status%)& ">"
 End If 
End Function

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Jon Lindgren. Please let others know how useful it is via the rating scale at the end of the tip. 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 April 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.