Solved

workstation list

Posted on 2001-06-19
6
227 Views
Last Modified: 2010-05-02
how can i get a list of the workstations connected to the same domain i m connected to or if i can change the domain
to get tha stations connected to that domain ? then to add them to a list ...
0
Comment
Question by:raed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 15

Expert Comment

by:lyonst
ID: 6205875
Duplicate Question Post ... Please delete one.

Hi,

Try this article ...

Since getting my own home network this summer and playing around with NT Server, I have found many limitations on client/server machines for carrying out simple tasks. The API Viewer does not list any Winndows NT Networking API calls, but they are out there.

I dropped in on Inquiry.com's Ask the NT Pro (LJ Johnshon) to see what they had for VB. I found quite a few examples, along with a few of my own, and I have wrapped them up into an easy to use class module called CNetworkNT.

CNetworkNT exposes eight methods for you to use NT from within your VB apps. These methods include:

AddUser - Adds a new user to the current domain
AddUserToLocal - Adds a new user to the local group
ChangePassword - Changes a password for a user
GetDomains - Lists all the domains on the current network
GetLoggedOnUsers - Returns the state of all users on the network.
GetPrimaryDCName - Returns the Primary Domain Controller computer name
Login - Login a user to the network
SetServerInfo - Sets the comment of a server on the network

http://www.vbsquare.com/articles/ntvb/

Hope it helps.

T.
0
 
LVL 5

Accepted Solution

by:
AndrewDev earned 150 total points
ID: 6205902
Display networked computers in a list box

http://www.freevbcode.com/ShowCode.Asp?ID=554

or if you prefer to Get the Names of All Computers in the Domain Using ADSI/LDAP

Public Function AllComputers() As String()

'PURPOSE:  Gets all Computers for the current domain
'and returns them in a string array, using LDAP

'Requires: ADSI, LDAP provider
'This function tested on Windows 2000 RC2

'RETURNS: String array containing all
'Computers for the current domain

'Requires VB6 because in lower versions
'array cannot be return type for a
'function

'EXAMPLE
'Dim sArray() As String
'Dim iCtr As Integer

'sArray = AllComputers
'For iCtr = 0 To UBound(sArray)
'    Debug.Print sArray(iCtr)
'Next

Dim conn As New ADODB.Connection
Dim rs As ADODB.Recordset
Dim oRoot As IADs
Dim oDomain As IADs
Dim sBase As String
Dim sFilter As String
Dim sDomain As String

Dim sAttribs As String
Dim sDepth As String
Dim sQuery As String
Dim sAns() As String
Dim iElement As Integer

On Error GoTo errhandler:

Set oRoot = GetObject("LDAP://rootDSE")
sDomain = oRoot.Get("defaultNamingContext")
Set oDomain = GetObject("LDAP://" & sDomain)
sBase = "<" & oDomain.ADsPath & ">"
sFilter = "(&(objectCategory=Computer))"
sAttribs = "name"
sDepth = "subTree"

sQuery = sBase & ";" & sFilter & ";" & sAttribs & ";" & sDepth
                   
conn.Open _
  "Data Source=Active Directory Provider;Provider=ADsDSOObject"
 
Set rs = conn.Execute(sQuery)
ReDim sAns(0) As String

With rs
    Do While Not .EOF
        iElement = IIf(sAns(0) = "", 0, iElement + 1)
        ReDim Preserve sAns(iElement) As String
        sAns(iElement) = rs("name")
       .MoveNext
    Loop
End With
AllComputers = sAns

errhandler:

On Error Resume Next
If rs.State <> 0 Then rs.Close
If conn.State <> 0 Then conn.Close
Set rs = Nothing
Set conn = Nothing
Set oRoot = Nothing
Set oDomain = Nothing

End Function
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6205908
You might also find these useful

Computer Viewer/Verifier For Windows NT/2000
http://www.freevbcode.com/ShowCode.Asp?ID=1893

Administer NT/2000 Users, Computers, and Domains Using ADSI/WMI
http://www.freevbcode.com/ShowCode.Asp?ID=1896

Hope this helps
Andrew
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:Netminder
ID: 6767444
There has been no activity in this question in quite some time, and it looks like it has been abandoned. As part of our ongoing mission to clean up the topic areas, a Moderator will finalize this question within the next seven (7) days. At that time, either I or one of the other Moderators will force/accept the comment of AndrewDev.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER. If you have further comments on this question or the recommendation, please leave them here.

raed,

Some of these questions have been open for some time, and records indicate you logged in as recently as this week. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20261025
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20253068
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20193883
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20193880
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20193879
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20193268
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20174535
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20137815
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20130736

Thanks,

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6821421
Force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6821596
Thanks Netminder
Your doing a great job :-)

Andrew
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question