ashraf_t
asked on
Detecing Network
Hi, By using VB.Net i want to detect the computers' names which are connected to network, Can I ?
Thanx
Thanx
The adpath you'll have to figure out for yourself. Try something like this(replace DOMAINNAME):
Dim adpath As String = "LDAP://DOMAINNAME.LOCAL/C N=Computer s,DC=DOMAI NNAME,DC=L OCAL"
... You can swap "CN=Computers" for "CN=Users" to get all the users.
For username and password, the credentials of a user with administrator rights to the server should be enough.
Dim username As String = "UserWithServerAdministrat orPrivileg es"
Dim password As String = "UsersPassword"
Dim adpath As String = "LDAP://DOMAINNAME.LOCAL/C
... You can swap "CN=Computers" for "CN=Users" to get all the users.
For username and password, the credentials of a user with administrator rights to the server should be enough.
Dim username As String = "UserWithServerAdministrat
Dim password As String = "UsersPassword"
ASKER
there is no active directory , it just a simple netwrok
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
//... Add this to the top of your code:
Imports System.DirectoryServices
//...Add this inside the Form Load EventHandler:
Dim objDirEnt As DirectoryEntry = New DirectoryEntry(adpath,user
Dim objChildDE As DirectoryEntry
For Each objChildDE In objDirEnt.Children
TextBox1.Text += objChildDE.Name + vbNewLine
Next objChildDE