This commit is contained in:
Jonathan Jenne 2019-11-06 09:54:43 +01:00
parent a15877c85c
commit 744a68c8d9
2 changed files with 34 additions and 17 deletions

View File

@ -149,26 +149,41 @@ Public Class ClassActiveDirectory
objectCategory = ""
End Try
If Not String.IsNullOrEmpty(groupName) Then
Dim isExcluded = excludedGroupNames.Where(Function(excludedGroup)
Return (groupName.Contains(excludedGroup) Or groupName.StartsWith(excludedGroup))
End Function).Any()
'If Not String.IsNullOrEmpty(groupName) Then
' Dim isExcluded = excludedGroupNames.Where(Function(excludedGroup)
' Return (groupName.Contains(excludedGroup) Or groupName.StartsWith(excludedGroup))
' End Function).Any()
' If Not isExcluded Then
' groups.Add(New GroupResult() With {
' .SAMAccountName = groupName,
' .CN = cn,
' .Description = description,
' .DistinguishedName = distinguishedName,
' .Name = name,
' .ObjectCategory = objectCategory,
' .ObjectClass = objectClass
' })
' End If
'End If
logger.Info("Adding Group '{0}'", groupName)
'If Not String.IsNullOrEmpty(groupName) Then
groups.Add(New GroupResult() With {
.SAMAccountName = groupName,
.CN = cn,
.Description = description,
.DistinguishedName = distinguishedName,
.Name = name,
.ObjectCategory = objectCategory,
.ObjectClass = objectClass
})
'End If
If Not isExcluded Then
groups.Add(New GroupResult() With {
.SAMAccountName = groupName,
.CN = cn,
.Description = description,
.DistinguishedName = distinguishedName,
.Name = name,
.ObjectCategory = objectCategory,
.ObjectClass = objectClass
})
End If
End If
Catch ex As Exception
'MsgBox("Error while fetching Active Directory groups", MsgBoxStyle.Critical)
logger.Error(ex)
Continue For
End Try
Next

View File

@ -7,6 +7,8 @@ Public Class frmADImport_Groups
Try
Dim groups = ClassActiveDirectory.GetActiveDirectoryGroups(My.Settings.AD_GROUP_QUERY)
logger.Info("Found {0} groups", groups.Count)
UserDataSet.TBLOCAL_ADGROUPS.Clear()
For Each group As ClassActiveDirectory.GroupResult In groups