JobRunner: add option to disable Firebird sync
This commit is contained in:
parent
50d205717f
commit
7d1c2ced5a
@ -2,4 +2,6 @@
|
||||
Inherits JobArgs
|
||||
|
||||
Public RootPath As String
|
||||
Public DisableFirebird As String
|
||||
Public DisableMSSQL As String
|
||||
End Class
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Data
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Jobs
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class ADSyncJob
|
||||
@ -26,13 +26,21 @@ Public Class ADSyncJob
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oGroups As List(Of ADGroup) = oSync.ListGroups()
|
||||
'Dim oGroups As List(Of ADGroup) = oSync.ListGroups()
|
||||
|
||||
_Logger.Debug("Found {0} Groups", oGroups.Count)
|
||||
' 30.04.19: MSSQL als führendes System
|
||||
Dim oGroups As New List(Of String)
|
||||
Dim oDatatable = _MSSQL.GetDatatable("SELECT NAME FROM TBDD_GROUPS WHERE AD_SYNC = 1 AND ACTIVE = 1")
|
||||
|
||||
_Logger.Debug("Found {0} Groups", oDatatable.Rows.Count)
|
||||
|
||||
For Each oRow As DataRow In oDatatable.Rows
|
||||
oGroups.Add(oRow.Item("NAME"))
|
||||
Next
|
||||
|
||||
For Each oGroup In oGroups
|
||||
_Logger.Debug("Syncing Group {0}", oGroup.Name)
|
||||
Dim oSyncedUsers = oSync.SyncUsersForGroup(oGroup.Name)
|
||||
_Logger.Debug("Syncing Group {0}", oGroup)
|
||||
Dim oSyncedUsers = oSync.SyncUsersForGroup(oGroup)
|
||||
|
||||
If oSyncedUsers Is Nothing Then
|
||||
_Logger.Warn("Group {0} could not be synced!", oGroup)
|
||||
|
||||
@ -254,7 +254,7 @@ Public Class ActiveDirectoryInterface
|
||||
Try
|
||||
Return Result.Properties.Item(PropertyName).Item(0)
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Property {0} not found", PropertyName)
|
||||
_logger.Debug("Property {0} not found", PropertyName)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
@ -105,6 +105,14 @@ Public Class JobRunner
|
||||
oADJobArgs.RootPath = oArgs.Item("RootPath")
|
||||
End If
|
||||
|
||||
If oArgs.ContainsKey("DisableFirebird") AndAlso oArgs.Item("DisableFirebird") = "True" Then
|
||||
oFirebird = Nothing
|
||||
End If
|
||||
|
||||
If oArgs.ContainsKey("DisableMSSQL") AndAlso oArgs.Item("DisableMSSQL") = "True" Then
|
||||
oMSSQL = Nothing
|
||||
End If
|
||||
|
||||
Dim oADSyncJob As New ADSyncJob(oLogConfig, oFirebird, oMSSQL)
|
||||
oADSyncJob.Start(oADJobArgs)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user