-2

We have a need to perform some mass deletion of accounts in Lotus notes. The figure will probably be somewhere around 10,000. We can process these manually but as you can imagine, we don’t have the resources to spare right now.

I’m wondering if we can able to script this deletion process using a CSV or Excel file as the input for the user names?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • You want to delete users in domino directory? – PoisonedYouth Oct 30 '14 at 12:52
  • Yes and also their mail files from the server and replica copies too. – user3712014 Oct 30 '14 at 14:40
  • Is there any way we can extract the data from Excel sheet to Lotus Notes through Lotus Notes Script?? – user3712014 Oct 30 '14 at 15:05
  • What data have you stored in Excel file? Usernames? – PoisonedYouth Oct 30 '14 at 15:08
  • Yes i am having username and their ID number and email id – user3712014 Oct 30 '14 at 15:12
  • I need a script which fetch the data from Excel sheet and put it in a view in Lotus Notes...Can you please help on this. – user3712014 Oct 30 '14 at 15:13
  • You can create a Lotus Script Agent which reads data from csv file and for every username makes a lookup on the user ID to get the person document in the domino directory. In a second step you can get the information about the mail files in the person document and delete the mail files (+ replicas) on server. – PoisonedYouth Oct 30 '14 at 15:21
  • I am not perfect with the scripting part so do you have a simple script which can fetch around 1000 users name from the excel sheet and place it in a view Lotus Notes... – user3712014 Oct 30 '14 at 15:44
  • Why do you want to place it in a view? I thought you want to delete the users in notes? – PoisonedYouth Oct 30 '14 at 15:45
  • Yes i do want to delete the user from NAB but before that i need to cross check the user name once before i proceed with the deletion – user3712014 Oct 30 '14 at 15:56
  • 2
    StackOverflow is really not the right place to come to ask for people to write your code for you or provide you with samples. It's the right place to come to ask for help after you found a sample yourself, or tried to write it yourself but you ran into problems. – Richard Schwartz Oct 30 '14 at 16:05

1 Answers1

1

You can use the following code in agent to read a csv file and create documents in notes database. Run the agent on server for better performance

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim fileCSV As String
Dim username As String
Dim userid As String
Dim email As string
Dim i As Integer
Dim filenum As Integer
i =0

Set db = session.CurrentDatabase

filenum% = FreeFile()
fileCSV = "C:\temp\export.csv"
Open fileCSV For Input As filenum%

Do Until EOF(filenum%)

    Input #filenum%, username, userid, email
    Set doc = db.CreateDocument
    With doc
        .username = username
        .userId = userid
        .email = email
        .form = "user"
    End With
    Call doc.save(False, False)
    i = i +1
Loop

To open the documents you have to create the form "user"

PoisonedYouth
  • 548
  • 3
  • 16