+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Find group membership and also which databases a person or group has access to

  1. Find group membership and also which databases a person or group has access to

    Is there a tool or some option to find out which groups a person is a member
    of? Also which databases a person or a group has access to?

    Regards

    Mailman



  2. Re: Find group membership and also which databases a person or group has access to

    All you need to do in create a view in your Domino Directory/Address Book
    named something like "Groups by People" and put this formula as the view
    selection.

    @Name([Abbreviate]; Members)

    Once this is done, and the view is accessed, it will show all the groups
    that the user is a part of.

    For the 2nd part of you question, to the best of my knowledge, the best you
    can do is check the members of a particular group in the groups view of you
    address book.

    -Tim


    "mailman" wrote in message news:416f5bdc@news.wineasy.se...
    > Is there a tool or some option to find out which groups a person is a

    member
    > of? Also which databases a person or a group has access to?
    >
    > Regards
    >
    > Mailman
    >
    >




  3. Re: Find group membership and also which databases a person or group has access to

    All you need to do in create a view in your Domino Directory/Address Book
    named something like "Groups by People" and put this formula as the view
    selection.

    @Name([Abbreviate]; Members)

    Once this is done, and the view is accessed, it will show all the groups
    that the user is a part of.

    For the 2nd part of you question, to the best of my knowledge, the best you
    can do is check the members of a particular group in the groups view of you
    address book.

    -Tim


    "mailman" wrote in message news:416f5bdc@news.wineasy.se...
    > Is there a tool or some option to find out which groups a person is a

    member
    > of? Also which databases a person or a group has access to?
    >
    > Regards
    >
    > Mailman
    >
    >




  4. Re: Find group membership and also which databases a person or group has access to

    There are some tools in the Admin Client that may help. All can be found on
    the "People & Groups" tab.

    Select "People". There is a tool to "Find User" - this will submit an
    AdminP request that should find all entities where the users name appears,
    including ACLs. Allow some time for ADMIN4.NSF to replicate around (and
    back) and then check the results.

    Select "Groups". There is an action button "Find Group Member" - this will
    run in the foreground, and will select all Group documents that have the
    name in it (this can take a while in large address books). At this point,
    you can select the tool to "Find Groups" - this will submit an AdminP
    request that should find all entities where the group name appears,
    including ACLs. Again, allow some time for ADMIN4.NSF to replicate around
    (and back) and then check the results.

    Tim Mohrlänt - tmohrlant@NO_JUNK_MAIL_comcast.net (remove NO_JUNK_MAIL_)


    "mailman" wrote in message news:416f5bdc@news.wineasy.se...
    > Is there a tool or some option to find out which groups a person is a

    member
    > of? Also which databases a person or a group has access to?
    >
    > Regards
    >
    > Mailman
    >
    >




  5. Re: Find group membership and also which databases a person or group has access to

    There are some tools in the Admin Client that may help. All can be found on
    the "People & Groups" tab.

    Select "People". There is a tool to "Find User" - this will submit an
    AdminP request that should find all entities where the users name appears,
    including ACLs. Allow some time for ADMIN4.NSF to replicate around (and
    back) and then check the results.

    Select "Groups". There is an action button "Find Group Member" - this will
    run in the foreground, and will select all Group documents that have the
    name in it (this can take a while in large address books). At this point,
    you can select the tool to "Find Groups" - this will submit an AdminP
    request that should find all entities where the group name appears,
    including ACLs. Again, allow some time for ADMIN4.NSF to replicate around
    (and back) and then check the results.

    Tim Mohrlänt - tmohrlant@NO_JUNK_MAIL_comcast.net (remove NO_JUNK_MAIL_)


    "mailman" wrote in message news:416f5bdc@news.wineasy.se...
    > Is there a tool or some option to find out which groups a person is a

    member
    > of? Also which databases a person or a group has access to?
    >
    > Regards
    >
    > Mailman
    >
    >




  6. Re: Find group membership and also which databases a person or group has access to

    There is a button (in the Lotus Sandbox) that allows you to do this easily.
    The button wirks by highlighting a user in the Directory and clicking. It
    will recurse down 20 levels and send yo an eMail with all the group info for
    the selected user.

    It is much less intrusive on the Directory than building special (probably
    huge) views.

    I will look for the code and post it for you soon.

  7. Re: Find group membership and also which databases a person or group has access to

    There is a button (in the Lotus Sandbox) that allows you to do this easily.
    The button wirks by highlighting a user in the Directory and clicking. It
    will recurse down 20 levels and send yo an eMail with all the group info for
    the selected user.

    It is much less intrusive on the Directory than building special (probably
    huge) views.

    I will look for the code and post it for you soon.

  8. Code as promised

    Option Declare
    Dim nab As NotesDatabase
    Dim SortedArray As Variant
    Sub Click(Source As Button)

    %REM
    Function NCT_getallvalidgroupsforuser(username As String, server As String,
    maxdepth As Integer) As Variant

    This sample code is distributed freely with only one obligation. You must
    distribute this code as a
    whole, including these comments, if you distribute it or re-use it at all.
    For help, please contact
    andrewp@thenorth.com
    Andrew Pollack
    Northern Collaborative Technologies
    %END REM


    ' first, get hold of the current document
    Dim workspace As New notesuiworkspace
    Dim mailDoc As notesdocument
    Dim ses As New NotesSession
    Dim userName, operatorName As NotesName
    Dim maxdepth As Integer
    Dim groupCount As String

    ' get the variables
    Set nab = ses.CurrentDatabase
    Set operatorName = New NotesName(ses.UserName)
    Set userName = New NotesName(ses.DocumentContext.FullName(0))
    maxdepth = 20

    ' make the call
    Dim v As Variant
    v = NCT_getallvalidgroupsforuser(userName.Canonical, nab.Server, maxdepth)

    'output the results
    'create mail doc and send it to operating user
    Call QuickSort(v)
    Set mailDoc = nab.CreateDocument
    Dim outtext As String
    outtext = "Includes nested groups up to 20 levels" & Chr$(13) & Chr$(10) &
    Chr$(13) & Chr$(10)
    Forall entry In SortedArray
    outtext = outtext & (entry & Chr$(13) & Chr$(10))
    End Forall
    ' add one to count as bounds start at 0
    groupCount = Str( Ubound(v) +1 )
    With mailDoc
    .Form = "Memo"
    .SendTo = operatorName.Abbreviated
    .Subject = "User: " & userName.Abbreviated & " is in the following " &
    groupCount & " groups."
    Call .AppendItemValue("Body" , outtext)
    Call .Send(False)
    End With
    Messagebox "Requested information has been mailed to your inbox"
    End Sub

    Function NCT_getallvalidgroupsforuser(username As String, server As String,
    maxdepth As Integer) As Variant

    %REM
    This function gets all the groups that a user can belong to.

    This is a RECURSIVE function, so be careful when modifying it.

    MAXDEPTH is used to regulate how far down in group levels it can go. If
    checking
    ACL groups, 6 is the limit, for mail groups its 20 -- but this can change
    with
    Domino versions in the future.

    This sample code is distributed freely with only one obligation. You must
    distribute this code as a
    whole, including these comments, if you distribute it or re-use it at all.
    For help, please contact
    andrewp@thenorth.com
    Andrew Pollack
    Northern Collaborative Technologies
    %END REM

    ' use static variables so that you can avoid repeatedly
    ' getting a handle to the same resources.
    ' Static nab As notesdatabase
    Static nabview As notesview
    Static userview As notesview
    Static foundlist List As String
    Static depth As Integer

    ' since depth is a static variable, each recursive call to this
    ' function will increase its value. We can also decrease its
    ' value so we know when we're back to the initial call.
    If depth => MAXDEPTH Then Exit Function
    depth = depth + 1

    ' check to see if we haven't already connected to the nab & views
    ' if not, connect now.
    ' If nab Is Nothing Then Set nab = New notesdatabase(server,"NAMES.NSF")
    ' If nab Is Nothing Then Exit Function
    If nabview Is Nothing Then Set nabview = nab.getview("($ServerAccess)")
    If userview Is Nothing Then Set userview = nab.getview("($Users)")
    If userview Is Nothing Then Exit Function
    If nabview Is Nothing Then Exit Function

    ' declarations
    Dim collection As notesdocumentcollection
    Dim doc As notesdocument
    Dim v As Variant
    Dim count As Integer
    Dim usercount As Integer
    Dim alreadyhandlednamevariants As Integer
    Redim usernamelist(0) As String
    Dim tempusernamelist As Variant

    ' first set the first username in the list to the current one as called
    ' keep in mind, if this is not the first call, but part of the recursion,
    ' this may be another variant of the name, or the name of a group
    usernamelist(0) = username

    ' this section will build an array of all the shortnames and name variants
    the user has
    ' by checking for a person record in the nab, using that to get the
    fullname of the user
    ' then calculating all the name variants on that (uses the function
    NCT_getNotesNameVariants)
    Set doc=userview.getdocumentbykey(username, True)
    If Not doc Is Nothing Then
    If doc.form(0) = "Person" Then
    usercount = 0
    Forall shortname In doc.fullname
    Redim Preserve usernamelist(usercount) As String
    usernamelist(usercount) = shortname
    ' don't recheck variants if you've already checked the name
    If Not alreadyhandlednamevariants = 1 Then
    tempusernamelist = NCT_getnotesnamevariants(shortname)
    'add all the found variants to the list of names to be checked
    Forall tusername In tempusernamelist
    usercount = usercount + 1
    Redim Preserve usernamelist(usercount)
    usernamelist(usercount) = tusername
    End Forall
    End If
    usercount = usercount +1
    End Forall
    End If
    End If

    ' this is the result that will be returned at the end of the function
    Redim returnlist(0) As String

    ' here's the meat of the function
    Forall checkusername In usernamelist 'for each name variant
    If Not checkusername = "" Then ' don't check 'empty' names
    Set collection = nabview.getalldocumentsbykey(checkusername,True) ' get
    any groups the name matches
    If Not collection.count = 0 Then ' if there are any matches
    Set doc = collection.getfirstdocument
    While Not doc Is Nothing ' loop through all the matching groups
    If Not doc.listname(0) = "" Then
    If Not Iselement(foundlist(doc.listname(0))) Then
    ' use this static list to avoid duplicate calls & infinite loops
    foundlist(doc.listname(0)) = "1"
    ' look! Here's the recursion! We're calling THIS function again
    ' with the new name variant. It will return the list from this
    ' variant. Deeper and Deeper it goes!
    v = NCT_getallvalidgroupsforuser(doc.listname(0), server, maxdepth)
    If Not Isempty(v) Then
    ' add the ones from the last depth to the current list,
    ' and prepare to return it to the one that called this one!
    Forall group In v
    If Not group = "" Then
    Redim Preserve returnlist(count) As String
    returnlist(count) = group
    count = count + 1
    End If
    End Forall
    End If
    Redim Preserve returnlist(count)
    returnlist(count) = doc.listname(0)
    count = count + 1
    End If
    Set doc=collection.getnextdocument(doc)
    End If
    Wend
    End If
    End If
    End Forall

    ' whew, now just return the list of all we found, plus all those found by
    ' any recursive calls we made, and the calls they made, and the calls they
    made...
    nct_getallvalidgroupsforuser = returnlist

    depth = depth -1
    If depth = 0 Then
    ' this exit will be the last recursion, so delete the static list so we
    can run again if we need!
    Erase foundlist
    End If
    End Function
    Function NCT_getnotesnamevariants(namestring) As Variant
    %REM
    This function returns all the possible entries that could be in a group or
    acl that
    would match the username. It includes wildcard matches and name style
    matches.

    This sample code is distributed freely with only one obligation. You must
    distribute this code as a
    whole, including these comments, if you distribute it or re-use it at all.
    For help, please contact
    andrewp@thenorth.com
    Andrew Pollack
    Northern Collaborative Technologies
    %END REM

    Redim returnarray(0) As String
    Dim templist List As String
    returnarray(0) = namestring

    Dim nme As New notesname(namestring)
    If Not nme.ishierarchical Then
    nct_getnotesnamevariants = returnarray
    Exit Function
    End If

    Dim countryadd As String
    If Not nme.country = "" Then countryadd = "/C=" & nme.country Else
    countryadd = ""
    templist("0") = "*"
    templist("1") = nme.abbreviated
    templist("2") = nme.common
    templist("3") = nme.canonical
    templist("4") = "*" & countryadd
    templist("5") = "*/O=" & nme.organization & countryadd

    Dim check As Integer
    check = 0
    If Not nme.orgunit1 = "" Then check = 1
    If Not nme.orgunit2 = "" Then check = 2
    If Not nme.orgunit3 = "" Then check = 3
    If Not nme.orgunit4 = "" Then check = 4

    Select Case check
    Case 1:
    templist("6") = "*/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    Case 2:
    templist("6") = "*/OU=" & nme.orgunit2 & countryadd
    templist("7") = "*/OU=" & nme.orgunit1 & "/OU=" & nme.orgunit2 & "/O=" &
    nme.organization &countryadd
    Case 3:
    templist("6") = "*/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    templist("7") = "*/OU=" & nme.orgunit2 & "/OU=" & nme.orgunit1 & "/O=" &
    nme.organization &countryadd
    templist("8") = "*/OU=" & nme.orgunit3 & "/OU=" & nme.orgunit2 & "/OU="
    & nme.orgunit1 & "/O=" & nme.organization & countryadd
    Case 4:
    templist("6") = "*/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    templist("7") = "*/OU=" & nme.orgunit2 & "/OU=" & nme.orgunit1 & "/O=" &
    nme.organization & countryadd
    templist("8") = "*/OU=" & nme.orgunit3 & "/OU=" & nme.orgunit2 & "/OU="
    & nme.orgunit1 & "/O=" & nme.organization & countryadd
    templist("9") = "*/OU=" & nme.orgunit4 & "/OU=" & nme.orgunit3 & "/OU="
    & nme.orgunit2 & "/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    End Select

    Forall f In templist
    Redim Preserve returnarray(Ubound(returnarray) +1) As String
    returnarray(Ubound(returnarray)) = f
    End Forall

    nct_getnotesnamevariants = returnarray
    End Function
    Function QuickSort(sArray As Variant)
    Dim sA() As String
    Dim j As Long
    Dim bottom As Long
    Dim top As Long
    bottom = Lbound ( sArray )
    top = Ubound ( sArray )
    Redim sA( bottom To top ) As String
    For j = bottom To top
    sA ( j ) = sArray ( j )
    Next
    ' DoQS does a QuickSort if the Sublist is longer than 10 elements
    ' Thus, when DoQS finishes, all elements are within 10 spots of their
    correct location.
    ' For lists that are close to being in order, an Insertion Sort is much
    faster than a QuickSort, so we
    ' run through the whole thing once doing an Insertion Sort to finish
    tidying up the order.
    Call DoQS( sA, bottom, top )
    Call DoInsertSort ( sA, bottom, top )
    SortedArray = sA
    End Function
    Sub DoQS( sA() As String, bottom As Long, top As Long )
    ' Called by QuickSort
    ' Uses Public variable sA (array of string)
    Dim length As Long
    Dim i As Long
    Dim j As Long
    Dim Pivot As Long
    Dim PivotValue As String
    Dim t As String
    Dim LastSmall As Long
    length = top - bottom + 1

    ' Only do the QuickSort if the sublist is at least 10 items long
    If length > 10 Then
    ' Pivot is chosen approx. halfway through sublist.
    ' This gives us best speed if list is almost sorted already, and
    is no worse than any
    ' other choice if the list is in random order.
    Pivot = bottom + (length \ 2)

    ' Move PivotValue out of the way
    PivotValue = sA( Pivot )
    sA ( Pivot ) = sA ( bottom )
    sA ( bottom ) = PivotValue

    ' LastSmall is the location of the last value smaller than
    PivotValue
    LastSmall = bottom
    For i = bottom + 1 To top
    If sA ( i ) < PivotValue Then
    LastSmall = LastSmall + 1
    t = sA ( i )
    sA ( i ) = sA ( LastSmall )
    sA ( LastSmall ) = t
    End If
    Next

    ' Move the PivotValue back
    t = sA ( LastSmall )
    sA ( LastSmall ) = sA ( bottom )
    sA ( bottom ) = t
    Pivot = LastSmall

    ' Now sort each side
    Call DoQS ( sA, bottom, Pivot - 1 )
    Call DoQS ( sA, Pivot + 1, top )
    End If

    End Sub
    Sub DoInsertSort ( sA() As String, Byval bottom As Long, Byval top As Long
    )
    Dim i As Long
    Dim x As Long
    Dim v As String
    Dim Found As Integer
    For i = bottom+1 To top
    x = i
    v = sA (i )
    Do While (sA(x-1) > v)
    sA ( x ) = sA ( x-1 )
    x = x - 1
    If x=0 Then
    Exit Do
    End If
    Loop
    sA (x) = v
    Next
    End Sub

  9. Code as promised

    Option Declare
    Dim nab As NotesDatabase
    Dim SortedArray As Variant
    Sub Click(Source As Button)

    %REM
    Function NCT_getallvalidgroupsforuser(username As String, server As String,
    maxdepth As Integer) As Variant

    This sample code is distributed freely with only one obligation. You must
    distribute this code as a
    whole, including these comments, if you distribute it or re-use it at all.
    For help, please contact
    andrewp@thenorth.com
    Andrew Pollack
    Northern Collaborative Technologies
    %END REM


    ' first, get hold of the current document
    Dim workspace As New notesuiworkspace
    Dim mailDoc As notesdocument
    Dim ses As New NotesSession
    Dim userName, operatorName As NotesName
    Dim maxdepth As Integer
    Dim groupCount As String

    ' get the variables
    Set nab = ses.CurrentDatabase
    Set operatorName = New NotesName(ses.UserName)
    Set userName = New NotesName(ses.DocumentContext.FullName(0))
    maxdepth = 20

    ' make the call
    Dim v As Variant
    v = NCT_getallvalidgroupsforuser(userName.Canonical, nab.Server, maxdepth)

    'output the results
    'create mail doc and send it to operating user
    Call QuickSort(v)
    Set mailDoc = nab.CreateDocument
    Dim outtext As String
    outtext = "Includes nested groups up to 20 levels" & Chr$(13) & Chr$(10) &
    Chr$(13) & Chr$(10)
    Forall entry In SortedArray
    outtext = outtext & (entry & Chr$(13) & Chr$(10))
    End Forall
    ' add one to count as bounds start at 0
    groupCount = Str( Ubound(v) +1 )
    With mailDoc
    .Form = "Memo"
    .SendTo = operatorName.Abbreviated
    .Subject = "User: " & userName.Abbreviated & " is in the following " &
    groupCount & " groups."
    Call .AppendItemValue("Body" , outtext)
    Call .Send(False)
    End With
    Messagebox "Requested information has been mailed to your inbox"
    End Sub

    Function NCT_getallvalidgroupsforuser(username As String, server As String,
    maxdepth As Integer) As Variant

    %REM
    This function gets all the groups that a user can belong to.

    This is a RECURSIVE function, so be careful when modifying it.

    MAXDEPTH is used to regulate how far down in group levels it can go. If
    checking
    ACL groups, 6 is the limit, for mail groups its 20 -- but this can change
    with
    Domino versions in the future.

    This sample code is distributed freely with only one obligation. You must
    distribute this code as a
    whole, including these comments, if you distribute it or re-use it at all.
    For help, please contact
    andrewp@thenorth.com
    Andrew Pollack
    Northern Collaborative Technologies
    %END REM

    ' use static variables so that you can avoid repeatedly
    ' getting a handle to the same resources.
    ' Static nab As notesdatabase
    Static nabview As notesview
    Static userview As notesview
    Static foundlist List As String
    Static depth As Integer

    ' since depth is a static variable, each recursive call to this
    ' function will increase its value. We can also decrease its
    ' value so we know when we're back to the initial call.
    If depth => MAXDEPTH Then Exit Function
    depth = depth + 1

    ' check to see if we haven't already connected to the nab & views
    ' if not, connect now.
    ' If nab Is Nothing Then Set nab = New notesdatabase(server,"NAMES.NSF")
    ' If nab Is Nothing Then Exit Function
    If nabview Is Nothing Then Set nabview = nab.getview("($ServerAccess)")
    If userview Is Nothing Then Set userview = nab.getview("($Users)")
    If userview Is Nothing Then Exit Function
    If nabview Is Nothing Then Exit Function

    ' declarations
    Dim collection As notesdocumentcollection
    Dim doc As notesdocument
    Dim v As Variant
    Dim count As Integer
    Dim usercount As Integer
    Dim alreadyhandlednamevariants As Integer
    Redim usernamelist(0) As String
    Dim tempusernamelist As Variant

    ' first set the first username in the list to the current one as called
    ' keep in mind, if this is not the first call, but part of the recursion,
    ' this may be another variant of the name, or the name of a group
    usernamelist(0) = username

    ' this section will build an array of all the shortnames and name variants
    the user has
    ' by checking for a person record in the nab, using that to get the
    fullname of the user
    ' then calculating all the name variants on that (uses the function
    NCT_getNotesNameVariants)
    Set doc=userview.getdocumentbykey(username, True)
    If Not doc Is Nothing Then
    If doc.form(0) = "Person" Then
    usercount = 0
    Forall shortname In doc.fullname
    Redim Preserve usernamelist(usercount) As String
    usernamelist(usercount) = shortname
    ' don't recheck variants if you've already checked the name
    If Not alreadyhandlednamevariants = 1 Then
    tempusernamelist = NCT_getnotesnamevariants(shortname)
    'add all the found variants to the list of names to be checked
    Forall tusername In tempusernamelist
    usercount = usercount + 1
    Redim Preserve usernamelist(usercount)
    usernamelist(usercount) = tusername
    End Forall
    End If
    usercount = usercount +1
    End Forall
    End If
    End If

    ' this is the result that will be returned at the end of the function
    Redim returnlist(0) As String

    ' here's the meat of the function
    Forall checkusername In usernamelist 'for each name variant
    If Not checkusername = "" Then ' don't check 'empty' names
    Set collection = nabview.getalldocumentsbykey(checkusername,True) ' get
    any groups the name matches
    If Not collection.count = 0 Then ' if there are any matches
    Set doc = collection.getfirstdocument
    While Not doc Is Nothing ' loop through all the matching groups
    If Not doc.listname(0) = "" Then
    If Not Iselement(foundlist(doc.listname(0))) Then
    ' use this static list to avoid duplicate calls & infinite loops
    foundlist(doc.listname(0)) = "1"
    ' look! Here's the recursion! We're calling THIS function again
    ' with the new name variant. It will return the list from this
    ' variant. Deeper and Deeper it goes!
    v = NCT_getallvalidgroupsforuser(doc.listname(0), server, maxdepth)
    If Not Isempty(v) Then
    ' add the ones from the last depth to the current list,
    ' and prepare to return it to the one that called this one!
    Forall group In v
    If Not group = "" Then
    Redim Preserve returnlist(count) As String
    returnlist(count) = group
    count = count + 1
    End If
    End Forall
    End If
    Redim Preserve returnlist(count)
    returnlist(count) = doc.listname(0)
    count = count + 1
    End If
    Set doc=collection.getnextdocument(doc)
    End If
    Wend
    End If
    End If
    End Forall

    ' whew, now just return the list of all we found, plus all those found by
    ' any recursive calls we made, and the calls they made, and the calls they
    made...
    nct_getallvalidgroupsforuser = returnlist

    depth = depth -1
    If depth = 0 Then
    ' this exit will be the last recursion, so delete the static list so we
    can run again if we need!
    Erase foundlist
    End If
    End Function
    Function NCT_getnotesnamevariants(namestring) As Variant
    %REM
    This function returns all the possible entries that could be in a group or
    acl that
    would match the username. It includes wildcard matches and name style
    matches.

    This sample code is distributed freely with only one obligation. You must
    distribute this code as a
    whole, including these comments, if you distribute it or re-use it at all.
    For help, please contact
    andrewp@thenorth.com
    Andrew Pollack
    Northern Collaborative Technologies
    %END REM

    Redim returnarray(0) As String
    Dim templist List As String
    returnarray(0) = namestring

    Dim nme As New notesname(namestring)
    If Not nme.ishierarchical Then
    nct_getnotesnamevariants = returnarray
    Exit Function
    End If

    Dim countryadd As String
    If Not nme.country = "" Then countryadd = "/C=" & nme.country Else
    countryadd = ""
    templist("0") = "*"
    templist("1") = nme.abbreviated
    templist("2") = nme.common
    templist("3") = nme.canonical
    templist("4") = "*" & countryadd
    templist("5") = "*/O=" & nme.organization & countryadd

    Dim check As Integer
    check = 0
    If Not nme.orgunit1 = "" Then check = 1
    If Not nme.orgunit2 = "" Then check = 2
    If Not nme.orgunit3 = "" Then check = 3
    If Not nme.orgunit4 = "" Then check = 4

    Select Case check
    Case 1:
    templist("6") = "*/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    Case 2:
    templist("6") = "*/OU=" & nme.orgunit2 & countryadd
    templist("7") = "*/OU=" & nme.orgunit1 & "/OU=" & nme.orgunit2 & "/O=" &
    nme.organization &countryadd
    Case 3:
    templist("6") = "*/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    templist("7") = "*/OU=" & nme.orgunit2 & "/OU=" & nme.orgunit1 & "/O=" &
    nme.organization &countryadd
    templist("8") = "*/OU=" & nme.orgunit3 & "/OU=" & nme.orgunit2 & "/OU="
    & nme.orgunit1 & "/O=" & nme.organization & countryadd
    Case 4:
    templist("6") = "*/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    templist("7") = "*/OU=" & nme.orgunit2 & "/OU=" & nme.orgunit1 & "/O=" &
    nme.organization & countryadd
    templist("8") = "*/OU=" & nme.orgunit3 & "/OU=" & nme.orgunit2 & "/OU="
    & nme.orgunit1 & "/O=" & nme.organization & countryadd
    templist("9") = "*/OU=" & nme.orgunit4 & "/OU=" & nme.orgunit3 & "/OU="
    & nme.orgunit2 & "/OU=" & nme.orgunit1 & "/O=" & nme.organization &
    countryadd
    End Select

    Forall f In templist
    Redim Preserve returnarray(Ubound(returnarray) +1) As String
    returnarray(Ubound(returnarray)) = f
    End Forall

    nct_getnotesnamevariants = returnarray
    End Function
    Function QuickSort(sArray As Variant)
    Dim sA() As String
    Dim j As Long
    Dim bottom As Long
    Dim top As Long
    bottom = Lbound ( sArray )
    top = Ubound ( sArray )
    Redim sA( bottom To top ) As String
    For j = bottom To top
    sA ( j ) = sArray ( j )
    Next
    ' DoQS does a QuickSort if the Sublist is longer than 10 elements
    ' Thus, when DoQS finishes, all elements are within 10 spots of their
    correct location.
    ' For lists that are close to being in order, an Insertion Sort is much
    faster than a QuickSort, so we
    ' run through the whole thing once doing an Insertion Sort to finish
    tidying up the order.
    Call DoQS( sA, bottom, top )
    Call DoInsertSort ( sA, bottom, top )
    SortedArray = sA
    End Function
    Sub DoQS( sA() As String, bottom As Long, top As Long )
    ' Called by QuickSort
    ' Uses Public variable sA (array of string)
    Dim length As Long
    Dim i As Long
    Dim j As Long
    Dim Pivot As Long
    Dim PivotValue As String
    Dim t As String
    Dim LastSmall As Long
    length = top - bottom + 1

    ' Only do the QuickSort if the sublist is at least 10 items long
    If length > 10 Then
    ' Pivot is chosen approx. halfway through sublist.
    ' This gives us best speed if list is almost sorted already, and
    is no worse than any
    ' other choice if the list is in random order.
    Pivot = bottom + (length \ 2)

    ' Move PivotValue out of the way
    PivotValue = sA( Pivot )
    sA ( Pivot ) = sA ( bottom )
    sA ( bottom ) = PivotValue

    ' LastSmall is the location of the last value smaller than
    PivotValue
    LastSmall = bottom
    For i = bottom + 1 To top
    If sA ( i ) < PivotValue Then
    LastSmall = LastSmall + 1
    t = sA ( i )
    sA ( i ) = sA ( LastSmall )
    sA ( LastSmall ) = t
    End If
    Next

    ' Move the PivotValue back
    t = sA ( LastSmall )
    sA ( LastSmall ) = sA ( bottom )
    sA ( bottom ) = t
    Pivot = LastSmall

    ' Now sort each side
    Call DoQS ( sA, bottom, Pivot - 1 )
    Call DoQS ( sA, Pivot + 1, top )
    End If

    End Sub
    Sub DoInsertSort ( sA() As String, Byval bottom As Long, Byval top As Long
    )
    Dim i As Long
    Dim x As Long
    Dim v As String
    Dim Found As Integer
    For i = bottom+1 To top
    x = i
    v = sA (i )
    Do While (sA(x-1) > v)
    sA ( x ) = sA ( x-1 )
    x = x - 1
    If x=0 Then
    Exit Do
    End If
    Loop
    sA (x) = v
    Next
    End Sub

  10. Re: Find group membership and also which databases a person or group has access to

    Another way to find the groups a person is a member of is to look at the
    ($ServerAccess) view in the Domino Directory. Be sure to use the canonical
    version of the users name (CN=Joe User/OU=JoesDept/O=...)

    Tim Mohrlänt - tmohrlant@NO_JUNK_MAIL_comcast.net (remove NO_JUNK_MAIL_)


    "mailman" wrote in message news:416f5bdc@news.wineasy.se...
    > Is there a tool or some option to find out which groups a person is a

    member
    > of? Also which databases a person or a group has access to?
    >
    > Regards
    >
    > Mailman
    >
    >




+ Reply to Thread
Page 1 of 2 1 2 LastLast