nobby Posted September 24, 2004 Share Posted September 24, 2004 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 Link to comment Share on other sites More sharing options...
nobby Posted September 24, 2004 Author Share Posted September 24, 2004 Thanks. Could not see the solution as it was too obvious... CheersNobby Link to comment Share on other sites More sharing options...
Josbe Posted September 24, 2004 Share Posted September 24, 2004 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) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
nobby Posted September 24, 2004 Author Share Posted September 24, 2004 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 Link to comment Share on other sites More sharing options...
t0ddie Posted September 24, 2004 Share Posted September 24, 2004 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. Link to comment Share on other sites More sharing options...
emmanuel Posted September 24, 2004 Share Posted September 24, 2004 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) Link to comment Share on other sites More sharing options...
t0ddie Posted September 24, 2004 Share Posted September 24, 2004 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. Link to comment Share on other sites More sharing options...
ioliver Posted September 24, 2004 Share Posted September 24, 2004 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 Link to comment Share on other sites More sharing options...
t0ddie Posted September 24, 2004 Share Posted September 24, 2004 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. Link to comment Share on other sites More sharing options...
nobby Posted September 25, 2004 Author Share Posted September 25, 2004 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 Link to comment Share on other sites More sharing options...
sugi Posted September 27, 2004 Share Posted September 27, 2004 (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 September 27, 2004 by sugi Link to comment Share on other sites More sharing options...
Guest vhuysj Posted March 5, 2005 Share Posted March 5, 2005 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 Link to comment Share on other sites More sharing options...
jdickens Posted March 7, 2005 Share Posted March 7, 2005 You could check out this script which was posted a while back:domainview scriptJ If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now