문제

Mail 파일 이름과 서버가있는 경우 LotusScript를 사용하여 "CN = xxx/o = yyy"형식으로 해당하는 사용자의 정규화 된 이름을 어떻게 검색합니까?

우선, 이메일에 @ 이전의 부분 인 사용자의 사용자 이름이 있습니다 : ie user1@example.com

또한이 사용자가 등록 된 서버도 알고 있으므로 registration.getuserinfo를 사용합니다.

Dim reg as New NotesRegistration
reg.RegistrationServer = "CN=myserver/O=mydomain"
Call reg.GetUserInfo("user1", mailserver$, mailfile$)

문제는 다음과 같습니다.이 데이터에서 사용자의 전체 이름을 얻을 수있는 방법은 무엇입니까?

도움이 되었습니까?

해결책 4

이 솔루션으로 끝났습니다 (사용자를위한 주소록 서버가 무엇인지 알 수 있습니다).

macro$ = { @DbLookup( "" ; "} & regServer & _
         {" : "names.nsf" ; "($Users)" ; "} & shortName & {" ; "FullName" ) }

Dim namelist As Variant

namelist = Evaluate ( macro$ )

commonName = namelist(0)

다른 팁

Jonesys 제안의 빠른 구현은 다음과 같습니다.

Function getMailFileUser(mailserver As String, mailfile As String) As String
    On Error Goto errorthrower  
    Dim session As New notessession

    Dim dd As NotesDatabase
    Forall candidate_dd In session.AddressBooks
        If candidate_dd.Server<>"" And candidate_dd.IsPublicAddressBook Then
            Set dd = candidate_dd
            Exit Forall
        End If
    End Forall 
    If dd Is Nothing Then Error 1978,"Failed to find Domino Directory"
    If Not dd.IsOpen Then Call dd.Open("","")


    Dim userdocs As NotesDocumentCollection
    Set userdocs = dd.Search({form="Person" & }& _
    {@name([CANONICALIZE];MailServer)=@name([CANONICALIZE];"} & mailserver & {") & } &_
    {MailFile="} & mailfile & {"},Nothing,1)

    Dim userdoc As NotesDocument
    Set userdoc = userdocs.GetFirstDocument
    If Not userdoc Is Nothing Then
        getMailFileUser = userdoc.FullName(0)       
    Else
        getMailFileUser=""
    End If

    Exit Function
ErrorThrower:
    Error Err, Error & Chr(13) + "Module: " & Cstr( Getthreadinfo(1) ) & ", Line: " & Cstr( Erl )
End Function

몇 가지주의 :

  • CANONICALIZE Domino 디렉토리가 아닌 현재 ID에서 값을 선택합니다 - 입력 mailserver 이것이 작동하려면 약식 또는 표준화 된 형태에 있어야합니다.
  • 그만큼 MailFile 필드 할 수도 있고 그렇지 않을 수도 있습니다 포함 .nsf 확대.
  • 파일 이름이 Windows에서는 CASE에 민감하다고 생각하지 않지만 다른 플랫폼에있을 수 있습니다.

이러한 조회를 자주 수행 해야하는 경우 계산 된 조회 테이블 또는 Domino 디렉토리의보기가 가장 효율적인 솔루션 일 것입니다.

메일 파일 이름이 있다면,이를 키로 사용하여 NAB를 조회하고 전체 이름을 얻으십시오.

인터넷 주소가있는 경우 NotesName 클래스 만 사용할 수 있습니다.

Dim s As New NotesSession
Dim userName As NotesName
Dim canonicalName as String

Set userName = s.CreateName("user@yourdomain.com")
'You can use the previous line or the next line to get the NotesName object
'Set userName = new NotesName("user@yourdomain.com")

canonicalName = userName.Canonical
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top