Page 1 of 1 1
Topic Options
#111521 - 2004-01-09 12:18 PM Running a script on remote PC's
bloodsoul Offline
Fresh Scripter

Registered: 2003-07-15
Posts: 9
Loc: uk
I have written a little Hardware/software inventory script. The script resides on my PC.
Pardon my ignorance , but how can I run the script from my PC so that it will get the data from the remote PC's.
e.g.
Test1
Test2
Test3
etc.
I would be grateful for any advice or help with this.

Thanks in advance
Ricky

Top
#111522 - 2004-01-09 12:36 PM Re: Running a script on remote PC's
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Theres a few ways of doing this. The easiest would be to do a search for software inventory on this board and look at how other people run there scripts.

You could enter the script into your login script if you have one and have it send details to a log file.
Or do what I do and just have a list of pc's and get the script to read the list and then report back. The only problem with this is that you wont be able to use macros as they can only run on the pc that the script is executed on.

Can you post your script and i could help further?
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#111523 - 2004-01-09 01:57 PM Re: Running a script on remote PC's
bloodsoul Offline
Fresh Scripter

Registered: 2003-07-15
Posts: 9
Loc: uk
Azzershaw
Thanks for the advice, i can see I will have problems. First I use macros and the script also uses about 4 udf's.
I cannot put this script in the logon scripts, they don't always use them.
I can compile either a list of PC's or Ip address's but i do not know how to referance the list.
I am very new to script writing so Hints would be a great help.
I have a few things to add to the script and i will try and post today, if not on Monday. please take a look and let me know what you think.

thanks
Ricky

Top
#111524 - 2004-01-09 02:00 PM Re: Running a script on remote PC's
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
do a search here for remote execution manager
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#111525 - 2004-01-09 02:35 PM Re: Running a script on remote PC's
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
The guys here will probably have a much better script but just so you can get an idea of how mine works I'll post it below (Amended a bit mind but you will get the idea)
It searches from my pc and will report back on software installed, OS version, service pack, IE etc if you want you could make it search on Ip by doing a search here for "Check Remote IP "
It starts by doing a new view in a bat file the executes the script.

Code:
  

net view /domain:domain >c:\Temp\ListPc.Txt



Code:
 

$Winword6 = "c_drive\MSoffice\Winword\winword.exe"

$Excel5 = "c_drive\MSoffice\Excel\Excel.exe"

$Word97 = "C_Drive\Program Files\Microsoft Office\Office\Winword.exe"

$Excel97 = "C_Drive\Program Files\Microsoft Office\Office\Excel.exe"


Open (1,"\\comp\listpc")

Do
$CompName=ReadLine(1)
$compname = SubStr($compname,1,8)
$compname = Trim($compname)


$CompName=ReadLine(1)

; gets operating system
$os_version = ReadValue("$compname\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","ProductName")
; gets internet explorer version
$os_version_ie = ReadValue("$compname\hkey_local_machine\software\microsoft\internet explorer","version")
; gets service pack version
$os_service = ReadValue("$compname\hkey_local_machine\software\microsoft\windows nt\currentversion","csdversion")
; below shows the size of the hard drive
$diskspace = GetDiskSpace("$compname\c_drive\") /1024


WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," disk space remaining (in mb) "," $diskspace")
WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," $os_version "," $os_service")
WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," Internet Explorer "," $os_version_ie ")

If Exist ("$compname\c_drive\program files\adobe\acrobat 4.0\reader\acrord32.exe")
WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," Adobe Reader "," Version 4 is installed")
EndIf

If Exist ("$compname\c_drive\program files\adobe\acrobat 5.0\reader\acrord32.exe")
WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," Adobe Reader "," Version 5 is installed")
EndIf

If Exist ("$compname\c_drive\program files\adobe\acrobat 6.0\reader\acrord32.exe")
WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," Adobe Reader "," Version 6 is installed")
EndIf

If Exist ("$compname\c_drive\windows\system32\adobe\svg viewer")
WriteProfileString("%systemdrive%\temp\Results.txt","$compname"," Adobe "," SVG viewer is installed")
EndIf


If Exist("$CompName\$Winword6")=1
WriteProfileString("%systemdrive%\Temp\ListPc.Txt","$Compname","Word ver 6"," Installed")
EndIf

If Exist("$CompName\$Excel5")=1
WriteProfileString("%systemdrive%\Temp\ListPc.Txt","$Compname","Excel 5"," Installed")
EndIf

If Exist("$CompName\$Word97")=1
WriteProfileString("%systemdrive%\Temp\ListPc.Txt","$Compname"," Word 97 "," Installed")
EndIf

If Exist("$CompName\$Excel97")=1
WriteProfileString("%systemdrive%\Temp\ListPc.Txt","$Compname"," Excel 97 "," Installed")
EndIf



Until $CompName = ""




My script is much larger then that but you get a general idea

_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#111526 - 2004-01-09 02:56 PM Re: Running a script on remote PC's
bloodsoul Offline
Fresh Scripter

Registered: 2003-07-15
Posts: 9
Loc: uk
Azzershaw
Thanks for that
I might give this a try over the weekend.

Cherrs
Ricky

Top
#111527 - 2004-01-09 03:34 PM Re: Running a script on remote PC's
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You should have written the script from the beginning in such a way that it can query remote computers, e.g. by using remote registry reads and WMI instead of macros.

Alternatively, use the ScheduleTask() UDF to run the scripts on remote computers. There are numerous examples on how to do this including an FAQ referencing ScheduleTask().
_________________________
There are two types of vessels, submarines and targets.

Top
#111528 - 2004-01-09 03:46 PM Re: Running a script on remote PC's
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Jens,
In Rickys defense, he didnt realise that you couldnt use macros remotley.

Regards
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#111529 - 2004-06-06 08:51 PM Re: Running a script on remote PC's
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I wounder how you'd think that macros could be used remotely in the first place as they don't even provide for the input of a remote computer name?
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.135 seconds in which 0.081 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org