Ссылка скрыта от гостей
Applies to
HCL Domino Designer 11.0.x and later versions
Introduction
If a situation arises that requires changing several or all users' HTTP passwords, an agent can be used to do this. Below are two examples of agents that can be used to accomplish this. Agents must be signed by an ID or run by a user with permissions to update person documents in names.nsf.
Instructions
How to reset all users' HTTP Passwords
%REM
Agent ResetAllHTTPPasswords
Created Mar 12, 2021 by Support Admin/HCL
Description: This agent will access the server provided and loop through
all of the person document and change the HTTP password to the new one provided
Target for the agent should be None
This agent can be added to any Database
%END REM
Option Public
Option Declare
Sub Initialize
Dim s As New NotesSession
Dim nab As NotesDatabase
Dim pview As NotesView
Dim pdoc As NotesDocument
Dim sServer As String
Dim sPassword As String
sServer = "127.0.0.1" ' Change this the name or IP address of the server
sPassword = "ABcd1234" ' change this to be the new password
Set nab = s.Getdatabase(sServer, "names.nsf")
Set pview = nab.GetView("($People)")
Set pdoc = pview.Getfirstdocument()
While Not pdoc Is Nothing
Dim temp As Variant
temp = Evaluate(|@Password("| & sPassword & |")|)
pdoc.HTTPPassword = temp
pdoc.HTTPPasswordChangeDate = Now
Call pdoc.save(True, False)
Set pdoc = pview.Getnextdocument(pdoc)
Wend
End Sub
Here is an example for selected documents
%REM
Agent ResetSelectedHTTPPassword
Created Mar 12, 2021 by Support Admin/HCL
Description: This Agent will Change the HTTPPassword for all the selected documents
The target of this agent will be all Selected documents
This agent will need to be added to the names.nsf
%END REM
Option Public
Option Declare
Sub Initialize
Dim s As New NotesSession
Dim nab As NotesDatabase
Dim pcoll As NotesDocumentCollection
Dim pdoc As NotesDocument
Dim sServer As String
Dim sPassword As String
sPassword = "ABcd1234" ' change this to be the new password
Set nab = s.Currentdatabase
Set pcoll = nab.Unprocesseddocuments
Set pdoc = pcoll.Getfirstdocument()
While Not pdoc Is Nothing
Dim temp As Variant
temp = Evaluate(|@Password("| & sPassword & |")|)
pdoc.HTTPPassword = temp
pdoc.HTTPPasswordChangeDate = Now
Call pdoc.save(True, False)
Set pdoc = pcoll.Getnextdocument(pdoc)
Wend
End Sub
Disclaimer: The above sample code is provided to you solely for the purpose of assisting you in the development of your applications. The code is provided "AS IS", without warranty of any kind. HCL shall not be liable for any damages arising out of your use of the sample code, even if they have been advised of the possibility of such damages.