The IBM Lotus iNotes Redirect database is an application that can be used to redirect a user's browser to their iNotes mailfile based on the credentials provided by the user. One of the options available when configuring this database is the ability to enable "Personal Options", which allows users to customize the interface they are redirected to -- such as Lite, Ultralite, or a Portal UI.
Any personal options that are configured by the user are stored in a user-specific profile document within the database. Profile documents are like other database documents except they are somewhat invisible -- they do not display in views and are not included in a document count for the database.
In some cases, it may be necessary to delete these profile documents for one user (or all users) because of corruption or invalid settings that have been saved. In order to accomplish this in the iNotes Redirect database, the following LotusScript agents can be created using Domino Designer and run from a Notes Client.
Agent to delete all profile documents (personal options for all users) in the iNotes Redirect database:
%REM
Agent DeleteAllProfileDocs
%END REM
Option Public
Option Declare
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Set db = s.currentdatabase
Set col = db.GetProfileDocCollection
Call col.RemoveAll(True)
MessageBox "All Profiles Document Deleted"
End Sub
Agent to delete one profile document (personal options for a specific user) in the iNotes Redirect database:
%REM
Agent DeleteProfileDoc
%END REM
Option Public
Option Declare
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim item As NotesItem
Dim profileUserName As String
profileUserName=InputBox("Please enter the name of the user in canonical format (i.e. cn=user name/o=org)")
Set db = s.currentdatabase
Set doc = db.GetProfileDocument("wmrprofile", profileUserName$)
Set item = doc.GetFirstItem("WMRProfileURL")
If ( item Is Nothing ) Then
MessageBox "Profile document not found for user:" & Chr(10) & profileUserName$
Else
Call doc.Remove(True)
MessageBox "Profile document deleted"
End If
End Sub
Steps to create an agent in the iNotes Redirect database:
1. Launch the Domino Designer client, and open the Redirect database.
2. Select "Shared Code" or Code > Agents from Navigation Tree on the left. Then click "New Agent."
3. Enter a name for your agent, such as "DeleteAllProfileDocs", and set the agent type to "LotusScript"
4. Copy and paste the code from above where appropriate.
5. Save the agent and close Domino Designer.
6. Open the Redirect database in a Notes Client. From the Actions menu, select your agent name and run the agent. You will be prompted for the username of the profile document to delete, or it will delete all profile documents -- depending on which agent you have chosen to use.
7. When the affected user logs in again, they can adjust their "Personal Options" or keep the new default settings.