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

Discussion

Discussion

Automating LFDS user creation with Laserfiche.LicenseManager

posted on May 9, 2017 Show version history

This is a VB method I created to add AD accounts as Named Users to the LFDS site:

Imports Laserfiche.LicenseManager

    ''' <span class="code-SummaryComment"><summary>
    ''' Procedure to create a new LF Active Directory User account in LDS Site
    ''' </summary></span>
    ''' <span class="code-SummaryComment"><param name="sLDSServer">Laserfiche Directory Service Server FQDN</param></span>
    ''' <span class="code-SummaryComment"><param name="sRealmName">LFDS Site Name</param></span>
    ''' <span class="code-SummaryComment"><param name="sUserName">AD User name - "Domain\User"</param></span>
    ''' <span class="code-SummaryComment"><param name="sUserSID">AD SID for user - </param></span>
    ''' <span class="code-SummaryComment"><remarks></remarks></span>
    Private Sub AddNamedUserWithFullLicense(ByVal sLDSServer As String, ByVal sRealmName As String, ByVal sUserName As String, ByVal sUserSID As String)
        Try
            ' Create a new LDS Server instance
            Using LDSServer As LMO.Server = LMO.Server.Connect(sLDSServer, False)
                ' Load the LFDS Site
                Dim LDB As LMO.Database = LDSServer.GetDatabaseByRealmName(sRealmName)
                ' Log into site using Windows Authentication
                LDB.LoginWindows()
                ' Create a new LDS AD User object
                Dim ADUser As LMO.ActiveDirectoryUser = LMO.ActiveDirectoryUser.Create(LDB)
                ' Set Identity Provider property
                ADUser.IdentityProviderID = LMO.IdentityProviderType.ActiveDirectory
                ' Set Name property
                ADUser.Name = sUserName
                ' Set SID property
                ADUser.SIDString = sUserSID
                ' Set Enabled property
                ADUser.Enabled = True
                ' Create a Guid Array for Licensing
                Dim LG(0) As Guid
                ' Add Full license to Guid Array
                LG(0) = LMO.WellKnownLicenseType.Full
                ' Set Licenses property
                ADUser.Licenses = LG
                ' Save the user to LDS
                Dim iResult As Integer = ADUser.Register()
            End Using
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

 

Since we have no documentation yet for Laserfiche.LicenseManager, this was all trial and error.  If anyone else has a better way or more options/info, we look forward to hearing it.

 

Note: the LicenseManagerObjects.dll is installed as part of LFDS and by default is located at "C:\Program Files\Laserfiche\Directory Server\".  Add it as a reference to your project.

3 0
replied on May 9, 2017

As a note, we now have some documentation available on a per-request basis. Please contact your regional manager for more information.

0 0
replied on January 31, 2019

I need this documentation to migrate 500+ users from Repository users to LFDS users, with 0 downtime allowed for end users.

I will certainly send the request to our Regional Manager, but at the same time I would appreciate your input.

Thanks and regards

Ignacio PdeA

BMB sal

0 0
replied on January 31, 2019

Hi Ignacio,

The good news is that we have a migration utility for repository -> LFDS users planned for release this quarter.

However, the utility is not zero-down time because it preserves information such as entry access rights, user attributes, and group membership, in part by directly modifying the LFS database.

Ideally, you would just bundle this migration alongside any routine maintenance on the LFS machine, since the migration utility will require that LFS is not modifying the database.

If you want to reduce the impact during the migration, you could try something like the following (not been tested, and always back everything up):

  1. Put everything into a read-only state in your LFS repository so that no data changes should occur (such as new entries, edited metadata, new annotations)
    1. This is assuming that read-only access is better than no access
  2. Replicate your database and LFS setup
  3. Run the upcoming migration utility on the replicated setup
  4. Swap in the updated database
    1. This would disrupt sessions and result in some down time, but should be fast compared to the migration itself

 

You can checkout our backup and recovery materials for suggestions on reducing downtime.

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

Sign in to reply to this post.