Find All Computer In Workgroup Or Domain

Hello!!!

How Can I Find All The Computer In "Workgroup" Or In "Domain" and map the selected computer "C$" drive?
traustiAsked:
Who is Participating?
 
intheConnect With a Mentor Commented:
download this example  to see how to enum the network then use
http://www.delphifreestuff.com/examples/wnetexmp.zip

then use like this to map the drives:

procedure TForm1.Button3Click(Sender: TObject);
var
 NetResource: TNetResource;
  begin
  { fill our TNetResource record structure }
 NetResource.dwType       := RESOURCETYPE_DISK;
 NetResource.lpLocalName  := 'S:';
 NetResource.lpRemoteName := '\\server\public';
 NetResource.lpProvider   := '';
{ map our network drive using our TNetResource
 record structure }
 WNetAddConnection2(NetResource,
      '', {Clave o vacio /Password or empty}
      '', {Nombre del usurio o vacio/User name o vacio}
 CONNECT_UPDATE_PROFILE);
   end;
{In that example, we will connect '\\server\public' to S:,
 without username neither password }
0
 
kretzschmarCommented:
hi barry,
now you will catch me soon
meikl ;-)
0
 
intheCommented:
somehow i doubt it ;-)
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
traustiAuthor Commented:
I want to make a Delphi app thats scans all network and find all active computers in the network and show me in listbox
0
 
intheCommented:
hello did you not try the example i show you?
 http://www.delphifreestuff.com/examples/wnetexmp.zip
0
 
intheCommented:
are you new to delphi?
if you need i change the example to listbox and i presume you want to add/map the found resources on a buttonclick.
0
 
traustiAuthor Commented:
Yes thank you
0
 
traustiAuthor Commented:
Yes Thanks
0
 
intheCommented:
ok wait for a bit (i eat tea first the missus is shouting me ;-)
0
 
intheCommented:
hello
do you need this in listbox or was the demo in treeview ok?
i tried listbox but could only get to computer names not the drivs as well :-(
but if it really need to be listbox ill ask a question to get someone else to do it(meikl listening :-)
btw how will you know the c drives? the enum network only gets the sharename not the actual drive .
are your share names like c:
0
 
kretzschmarCommented:
allways listening :-)
0
 
traustiAuthor Commented:
I will be able to get all the computers in the workgroup or domain e.g "TJONDLD" <-- this is the workgroup --> "TJON_TRAUSTI" <-- this is the computer name.

I will be able to get all the workgroups in treeview or listbox and double click and the i see all the computers in that workgroup. And when i click on one computer then i will be able to map the C$ drive and make shortcuts under c:\winnt\profiles\...\start menu\programs\

Is this possible?
0
All Courses

From novice to tech pro — start learning today.