You are viewing limited content. For full access, please sign in.

Question

Question

How to get list of all windows accounts using Laserfiche SDK 10

asked on August 6, 2018

I have Laserfiche RIO 10 using SDK 10 

In my web application I use following code to get all 663 windows accounts created in a repository.

But this code only returns 3 account

        Dim db As LFDatabase
                ' Gets a repository’s list of trusted Windows accounts.

                Dim TrustedList As LFGrantedDomainAccountCollection = db.TrustedDomainAccounts

 

I suspect there must be another way, as I have seen a table account_cache that has all the list of DOMAIN\User(s)

 

Please help

0 0

Answer

SELECTED ANSWER
replied on August 6, 2018

It has been a long time since I have worked with LFSO, but something like this should do it.


    Private Function LFSO_GetWindowsUserList() As List(Of String)
        Dim lstUsers As List(Of String) = New List(Of String)
        Try
            Dim AllDomainUsers As LFSecuredDomainAccountCollection = LFDB.SecuredDomainAccounts
            For Each DU As LFDomainAccount In AllDomainUsers
                lstUsers.Add(DU.Name)
            Next
        Catch ex As Exception
            lstUsers = New List(Of String)
        End Try
        Return lstUsers
    End Function

 

2 0
replied on August 6, 2018

Thanks Mr. Waren, problem solved by using LFSecuredDomainAccountCollection you suggested. 

You really saved a lot of my time. thanks you so much

0 0
replied on August 6, 2018

I believe the "db.TrustedDomainAccounts" are those that have the trust checkbox explicitly checked in the profile.

1 0
replied on August 6, 2018

Yes you are write, "db.TrustedDomainAccounts" returned only those that have the trust checkbox explicitly checked in the profile.

0 0

Replies

replied on August 6, 2018

These queries only return the specific members that the Laserfiche Server knows about - either users you have defined manually or who have already signed in once. Basically, it'd be the list you get when you look through the administration console. The Laserfiche Server will check against the AD server for authentication and authorization, but it doesn't immediately collect all those user accounts until they are used. If you want to get a list of all members of an AD account, I'd suggest querying AD directly. 

1 0
replied on August 6, 2018

Yes Justin, 

you are right, but in my case. We need the list for integration purpose.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.