Hello All

  • Thread starter Thread starter Wayne Taylor
  • Start date Start date
W

Wayne Taylor

I would like to list the Entire Network from within my VB.NET app and allow
the user to select mulipy machines... I would like to retain those machones
names so I can can pass them via (shell) to a Windows script for excution...

any suggestions?

thanks in advance, Wayne
 
Hi Wayne,

You can use the System.DirectoryServices to help you. For the following code
to work you will also have to add a reference to
System.DirectoryServices.dll.

Imports System.DirectoryServices

Dim de As New DirectoryEntry("WinNT://workgroup") ' Put the name of your
workgroup/domain here
Dim computer As DirectoryEntry

For Each computer In de.Children
ListBox1.Items.Add(computer.Name)
Next

Hope this helps

Chris Taylor
 
Chris:

I just saw your response and gave it a try. Seems like
there is a lot that you can do with this.... I was just
wondering, what other sort of things are you doing with
DirectoryServices? I just plugged in some code I wrote
before to force a remote shutdown of a machine, and your
code allows me to basically iterate through everything on
the network and shut down, reboot etc. I haven't had much
exposure to DirectoryServices, but it seems like you could
add users from an App without them having to have the
ActiveDirectory Console and the like. I guess I'm just
enamored with this and thinking of some good projects to
start that could help me to get more familiar with it.

Thanks again Chris

Billl
 
Thanks guys....

Chris thanks for the repsonse my code is almost the same as yours. I've
spent today reading and playing around with code.

I have a rough working example....I'm shelling out of my VB.NET app to run a
VBScript which shut's down the pc by machine name.

Do you know of anyway of doing this from within VB.NET.

Thanks again.

Wayne
 
Back
Top