
SPAM AND SECURITY
Dump name from ID file
Eric Jewett 11.14.2001
Rating: --- (out of 5)




|
Like many shops, we have a network directory with thousands of Notes ID files. Which variation of JSMITH.ID belongs to Jane Smith, who lost her id file or forgot her password. We are now naming by network account, but have many using default conventions. This agent reads through a directory of ID files and writes a file displaying the file name and the most current Notes canonical name (accounts for name changes in an id file).
Code
' Name: dump Notes ID file
' Purpose: prints name of id file and most current name stored in ID.
' prints NO NAME FOUND if no canonical name is found in the ID
' 09/26/01 - created. EAJ
Option Public
Option Declare
Sub Initialize
Dim f As Integer, g As Integer, i As Integer, j As Integer
Dim IDpath As String, IDfile As String, InLine As String, OutName As String
On Error Goto processError ' read past end of file
g% = Freefile
Open "c:idout.txt" For Output As #g%
IDpath = "h:NotesR5dataidspeople"
IDfile = Dir$(IDpath+"*.id")
Do While IDfile <> ""
f% = Freefile
Open IDpath+IDfile For Input As #f%
InLine = ""
OutName = "NO NAME FOUND"
Do Until Eof (f%)
InLine = InLine + Input$ (256, #f%)
i = Instr (InLine, "CN=")
If i > 1 Then
InLine = Mid$ (InLine, i) + Input$ (32, #f%)
j = Instr (InLine, "O=CHP")
If j > 0 Then
OutName = Left$ (InLine, j+5)
Inline = Mid$ (InLine, j+6)
Else
InLine = Mid$ (Inline, 3)
End If
Else
InLine = Right$ (InLine, 2)
End If
Loop
NextFile:
IDfile = Dir$()
Loop
Close g%
Exit Sub
processError:
Close f%
Print #g%,IDfile,OutName
Resume nextfile
End Sub
 |

|
|
 |
|
 |