Dump name from ID file

Dump name from ID file

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).


' 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:\Notes\R5\data\ids\people\"
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

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

If Loop NextFile: IDfile = Dir$() Loop Close g% Exit Sub processError: Close f% Print #g%,IDfile,OutName Resume nextfile End Sub

This was first published in November 2001

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.