Re: Scripting Adding computers to a list in ARD
Re: Scripting Adding computers to a list in ARD
- Subject: Re: Scripting Adding computers to a list in ARD
- From: Megan Mamalis <email@hidden>
- Date: Tue, 22 Aug 2006 16:17:26 -0400
- Thread-topic: Scripting Adding computers to a list in ARD
Title: Re: Scripting Adding computers to a list in ARD
OK, I was barking up the wrong tree. John, Axel, and Deivy thanks for your help. It was quite useful, as I’m rather new to exploring AS grammatical categories.
Script Overview:
Download the latest Virex DAT file
Run an ARD task to find out which computers already have it (ls –l /Library/Receipts | grep V706)
Create a list of computers that don’t have it
Execute a Task Server task to install the updates on the new list
As this is at least one level more complicated than anything I’ve attempted so far, I’m breaking it down into small bites, testing them by passing in properties that are what I’d expect to receive from the previous bite. At this point I’ve figured out the first step, except the crucial item: find the link on the Virex page to download the file from. Setting that aside for now.
Step 2- not a problem
Step 3- I can parse the results of the send UNIX command task to a list of IP addresses or computer IDs. I can create a new computer list from a list of computer names. I can’t figure out how to convert my list of IP addresses or computer IDS to a list of computer names. I’m not concerning myself at this point with filtering the results.
Here’s what I’ve got:
--in ARD, run a ls -al /Library/Receipts | grep V7.... (whatever the current update is) on all online machines
tell application "Remote Desktop"
set myresult to execute (make new send unix command task with properties {script:"ls -al /Library/Receipts | grep V7060821", showing output:true, user:"vcgvchj"}) on computer list "test"
end tell
--parse out the address key(s) from the output
property myresult : {|computerStatuses|:{{|id|:"asdfghjkl", address:"192.168.1.1", results:"“drwxrwxr-x 3 root admin 102 Aug 16 08:57 V7060813.pkg”"}, {|id|:"qwertyuiop", address:"192.168.1.2", results:"“drwxrwxr-x 3 root admin 102 Aug 18 08:13 V7060817.pkg”"}}, status:"Succeeded on all"}
set mycomps to {}
repeat with eachcomp in |computerStatuses| of myresult
--Maybe filter here with ~ if the results of contents of eachcomp contains V7060821 etc etc
set the end of mycomps to the address of (contents of eachcomp)
end repeat
get mycomps
--gives {"192.168.1.1", "192.168.1.2"}
--given a list of IP addresses, create a list variable of computer names
--How??
--make a computer list of everything that doesn't have that update
property mynewlist : {"PowerMac1", "PowerMac2"}
tell application "Remote Desktop"
repeat with c in mynewlist
add computer (contents of c) to computer list "test"
end repeat
end tell
Does someone have a handler to take a list of IP addresses and spit back a list of computer names? I’m not sure how to express the idea that I’m looking for the name property of the computer whose internet address property is xxx.xxx.xxx.xxx. Well, that could be expanded to any given property of any item whose other any given property is x.
--
Megan Mamalis
Macintosh Desktop Support Technician
--------------------------------------------
The information transmitted herein is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden