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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kretzschmarCommented:
hi barry,
now you will catch me soon
meikl ;-)
0
intheCommented:
somehow i doubt it ;-)
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.