Jump to content

List computers


nobby
 Share

Recommended Posts

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

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

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

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

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

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

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

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
Link to comment
Share on other sites

  • 5 months later...
Guest vhuysj

: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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...