diff --git a/Jobs/EDMI/ADSync/ADSyncArgs.vb b/Jobs/EDMI/ADSync/ADSyncArgs.vb index 1e64916b..86458756 100644 --- a/Jobs/EDMI/ADSync/ADSyncArgs.vb +++ b/Jobs/EDMI/ADSync/ADSyncArgs.vb @@ -2,4 +2,6 @@ Inherits JobArgs Public RootPath As String + Public DisableFirebird As String + Public DisableMSSQL As String End Class diff --git a/Jobs/EDMI/ADSync/ADSyncJob.vb b/Jobs/EDMI/ADSync/ADSyncJob.vb index 6245604f..486b62a3 100644 --- a/Jobs/EDMI/ADSync/ADSyncJob.vb +++ b/Jobs/EDMI/ADSync/ADSyncJob.vb @@ -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) diff --git a/Modules.Interfaces/ActiveDirectoryInterface.vb b/Modules.Interfaces/ActiveDirectoryInterface.vb index bd12e115..12a24afa 100644 --- a/Modules.Interfaces/ActiveDirectoryInterface.vb +++ b/Modules.Interfaces/ActiveDirectoryInterface.vb @@ -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 diff --git a/Service.JobRunner/JobRunner.vb b/Service.JobRunner/JobRunner.vb index aa378bb4..9bac2d36 100644 --- a/Service.JobRunner/JobRunner.vb +++ b/Service.JobRunner/JobRunner.vb @@ -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)