asked on
Public Sub ADRETRIEVE()
' On Error GoTo Next
Dim dirEntry As DirectoryEntry = New DirectoryEntry()
' NOTE: This path should be comma delimited, not semi-colon delimited
' Each label in the domain name should be a separate Domain Component (DC)
dirEntry.Path = "LDAP://OU=NAZ,OU=User Accounts,DC=one,DC=ads,DC=che,DC=org"
' dirEntry.Username = "ONE\Powerst9"
' dirEntry.Password = "Megadeth666$"
Dim mySearcher As DirectorySearcher = New DirectorySearcher(dirEntry)
' This value can be passed in the constructor if preferred.
mySearcher.Filter = "(objectClass=Person)"
mySearcher.PageSize = 1001
For Each resEnt As SearchResult In mySearcher.FindAll()
tscmbUsers.Items.Add(resEnt.Properties("Name")(0).ToString())
Dim lvi As ListViewItem = New ListViewItem()
' Dim listItem As New ListViewItew.Add(p.ProcessName.ToString())
lvi.ImageIndex = 0
lvi.SubItems.Add(resEnt.Properties("Name")(0).ToString())
lvi.SubItems.Add(resEnt.Properties("sAMAccountName")(0).ToString())
lvi.SubItems.Add(resEnt.Properties("Distinguishedname")(0).ToString())
' lvi.SubItems.Add(resEnt.Properties("phone")(0).ToString())
' List box is a bit simple for these unless I missed something
' lbADUsers.Items.Add(resEnt.Properties("sAMAccountName")(0).ToString())
' tscmbUsers.Items.Add(resEnt.Properties("aDSPath")(0).ToString())
' And this one needs some work unless you're attaching to every object within the directory.
' lbADUsers.Items.Add(resEnt.Properties("objectGUID")(0).ToString())
Next
txtNazUsers.Text = tscmbUsers.Items.Count
End Sub
OK Know this is a Global OU with Group I want to pull all Groups from but I get a Com Unspecified ErrorPublic Sub ADGlobal()
' On Error GoTo Next
Dim dirEntry As DirectoryEntry = New DirectoryEntry()
' NOTE: This path should be comma delimited, not semi-colon delimited
' Each label in the domain name should be a separate Domain Component (DC)
dirEntry.Path = "OU=Unified Data Centers,OU=Groups Application,DC=one,DC=ads,DC=che,DC=org"
dirEntry.Username = "ONE\Powerst9"
dirEntry.Password = "Megadeth666$"
Dim mySearcher As DirectorySearcher = New DirectorySearcher(dirEntry)
' This value can be passed in the constructor if preferred.
mySearcher.Filter = "(objectClass=group)"
mySearcher.PageSize = 1001
lvGroups.Columns.Add("Image", 100, HorizontalAlignment.Center)
lvGroups.Columns.Add("Global Group Name", 650, HorizontalAlignment.Center)
For Each resEnt As SearchResult In mySearcher.FindAll()
' tscmbUsers.Items.Add(resEnt.Properties("Name")(0).ToString())
Dim lvi As ListViewItem = New ListViewItem()
' Dim listItem As New ListViewItew.Add(p.ProcessName.ToString())
lvi.ImageIndex = 1
' lvi.SubItems.Add(resEnt.Properties("Name")(0).ToString())
lvi.SubItems.Add(resEnt.Properties("sAMAccountName")(0).ToString())
lvGlobal.Items.Add(lvi)
' lvGroups.Sort(resEnt.Properties("Name")(0).ToString())
lvGlobal.EndUpdate()
Next
txtNazUsers.Text = tscmbUsers.Items.Count
End Sub
Not grabbing Global OU I'm remotted into my PC at Work I'll be back after areboot no memory to take screenshots.
ASKER
Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,
TRUSTED BY
ASKER
Open in new window
Is there anyway to databindn or Sync up a combobox with same data in a listview Checkout Pics
What I'd like to have syncronize are
And here is my Global group that I need to pull by itself with goal being to add some of these groups to a current user profile that is it please don't run for the hills.