#111521 - 2004-01-09 12:18 PM
Running a script on remote PC's
|
bloodsoul
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
|
|
|
|
#111523 - 2004-01-09 01:57 PM
Re: Running a script on remote PC's
|
bloodsoul
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
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
do a search here for remote execution manager
|
|
Top
|
|
|
|
#111525 - 2004-01-09 02:35 PM
Re: Running a script on remote PC's
|
AzzerShaw
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
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|