MS SyncUsers

This commit is contained in:
2022-03-25 10:35:53 +01:00
parent 0c659d9f72
commit 5361b749aa
4 changed files with 12 additions and 16 deletions

View File

@@ -113,6 +113,7 @@ Namespace SyncUsers
' Delete users that are assigned to the group but no longer exist in active directory
Dim oUserIdString = String.Join(",", oSyncedUserIds)
If oSyncedUserIds.Count = 0 Then
_logger.Info("Group {0} does not contain any users.", GroupName)
oUserIdString = 0
End If
Dim oSQL As String = $"DELETE FROM TBDD_GROUPS_USER WHERE USER_ID NOT IN ({oUserIdString}) AND GROUP_ID = {oGroupId}"