jj
This commit is contained in:
parent
a15877c85c
commit
744a68c8d9
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user