Sign in to follow this  
Followers 0
nobby

List computers

13 posts in this topic

I am trying to populate a combo box with a list of all computers in a network. Unfortunately I cannot find a way of getting the list.

Can anyone point me in the right direction.

Thanks


CheersNobby

Share this post


Link to post
Share on other sites



Thanks.

Could not see the solution as it was too obvious...


CheersNobby

Share this post


Link to post
Share on other sites

First, maybe:

"NET VIEW /DOMAIN" (searching available workgroups) then,

"NET VIEW /DOMAIN:$everyDomain" (searching pc names in every workgroup/domain)...

and "NET VIEW" (for local workgroup)

:ph34r:

Share this post


Link to post
Share on other sites

Here is what I was working towards. Not pretty, there may be some cleaner ways of doing it.

The script will look for all computers in the domain, prepare a list that can be used to populate a combo box. From there, you can choose a PC, enter a comment and write it to that PC's registry.

Assumptions:

Running the latest Unstable version

Computer name do NOT contain blank spaces

I suppose that I'd better upload the compiled script..

PC_Comment.au3

Thanks for you help


CheersNobby

Share this post


Link to post
Share on other sites

nice. i have been looking for something similar. but i have no idea how to write it.

what i am trying to do is create a script that when you run it, it will

copy and run itself on every computer in the network

any suggestions?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

nice. i have been looking for something similar. but i have no idea how to write it.

what i am trying to do is create a script that when you run it, it will

copy and run itself on every computer in the network

any suggestions?

<{POST_SNAPBACK}>

I think PSinternals has a remote execute tool... look into that?

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

well, im not looking for a tool.

more or less code.

pretty much just want a script that does it all itself, without having to rely on user input.

so, you just run the script on this computer

and then, the 3 other computers i have networked to this will automatically start running the program also

get it?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

The PSTools that emmanuel mentioned should work. Just have your script FileInstall() psexec.exe and 'yourcompiledscript.exe' to the \\computername\c$ share and then have your script use psexec.exe to run the script on the remote computer. You may not even need to FileInstall() the psexec.exe.

Just my thoughts.

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

ok then, here we go

Direct PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of "\\*" PsExec runs the applications on all computers in the current domain.

usage: psexec [\\computer[,computer[,..] | @file ][-u user [-p psswd]][-n s][-s|-e][-i][-c [-f|-v]][-d][-w directory][-<priority>][-a n,n,...] cmd [arguments]

so, correct me if im wrong.. but if i wanted to run a file on all computers connected to mine.. i would make a script like this.

run (@ComSpec & "psexec [\\*[,computer[,..] | @file ][-u user [-p psswd]][-n

ok, im going to just stop now.

i have no idea what i am doing.

but i dont need to guess names.. as supposedly this will find them all.

as for passwords.. not all networked computers have passwords right?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

psexec is very nice indeed, unfortunately I found that some antivirus software prevent remote exec programs to run.

As per a script that self propagate, I suppose you could be looking at using the computer listing, then copy a script to each local PC and create a registry entry on each PC under HKLM\Software\Microsoft\Windows\CurrentVersion\Run.

Instead of creating a list separated by "|", just use the list separated by a @CRLF, then you can do a loop that reads each line until the end of the file. There are many examples in the helpfile.

Hope it is pointing you in the right direction


CheersNobby

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Somewhere in the internet I found the following VBS-script that reads all computers that are known to the domain. Not only those who are online or were online a few hours ago. The script requires WinXP or Win2k.

Just start it like "cscript script.vbs DOMAIN" and it will create a DOMAIN.TXT containing the names of all computers.

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

Dim objDomain
Dim objComputer
Set objDomain = GetObject("WinNT://" & objArgs(0))
objDomain.Filter = Array("computer")

If objFSO.FileExists(objArgs(0) & ".txt") = True Then
  objFSO.DeleteFile(objArgs(0) & ".txt")
End If
Set txtOutput = objFSO.CreateTextFile (objArgs(0))

On Error Resume Next

For Each objComputer In objDomain
  strComputer = objComputer.Name
  txtOutput.Writeline objArgs(0) & "\" & strComputer
Next

WScript.Echo "Done!"
Edited by sugi

Share this post


Link to post
Share on other sites

:lmao:

You can use this batch file i wrote with the microsoft netdom.exe and psexec to get all the computers in the domain in to a txt file and install software on that list:

del /Q *.txt

netdom /d:costec /noverbose member > Machines1.txt

for /F "delims=\\ tokens=1" %%a in (Machines1.txt) do echo %%a >> Machines2.txt

for /F "delims=\\" %%x in (Machines2.txt) do echo %%x >> workstationcheck.txt

C:\NWIZARD\NwAuagt\psexec.exe @workstationcheck.txt -u costec\administrator -p MiB6Mob@! -c -f agtcon.bat -s

Share this post


Link to post
Share on other sites

You could check out this script which was posted a while back:

domainview script

J


If I am too verbose, just say so. You don't need to run on and on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0