Can this script be converted to a UNIX command for ARD?

First I'd like to thank "Neil" again for providing the script below:
set the_versions to (do shell script "mdls -name kMDItemVersion /Applications/Microsoft\\ Office\\ 2011/Microsoft\\ Excel.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Adobe\\ Reader.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Safari.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Google\\ Chrome.app")
set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Adobe\\ Acrobat\\ X\\ Pro/Adobe\\ Acrobat\\ Pro.app")
set the_versions to the_versions & return & (do shell script "SW_vers")
Output for this script yields exactly what I requested in the thread.  Ex:
"kMDItemVersion = \"14.4.1\"
kMDItemVersion = \"11.0.07\"
kMDItemVersion = \"7.0.4\"
kMDItemVersion = \"35.0.1916.114\"
kMDItemVersion = \"10.1.10\"
ProductName:          Mac OS X
ProductVersion:          10.9.3
BuildVersion:          13D65"
I'd like to be able to run this command (or a variation) in Apple Remote Desktop (ARD) remotely, and as a UNIX command in order to generate a similar ARD report if possible.  Even better, I'd like the report to include the Application name and I'd like it to not to halt if an Application isn't present. My guess is that functionality like this for ARD would help a LOT of ARD Administrators because it would seem that the only way to do anything similar is to derive the metadata piecemeal (machine by machine) or end up having to wade through a ton of unwanted content using a full System Report...  Thanks.

Forum software NOW prevents posting complete shell scripts. You'll have to piece together the code.
First build an array of the applications that you are looking for in this form. Note; I truncated the applications.
apps=( "/Applications/Microsoft Office 2011/Microsoft Excel.app" "/Applications/Adobe Reader.app" "/Applications/Safari.app" )
Next loop thru the array
for i in "${apps[@]}"; do
     printf "%s: %s\n" "$i" "$(mdls -name kMDItemVersion "$i")"
done
If you want to create a report then change the above loop to the following
for i in "${apps[@]}"; do
     printf "%s: %s\n" "$i" "$(mdls -name kMDItemVersion "$i")"
done > app_report.txt
sw_vers >> app_report.txt
Message was edited by: Mark Jalbert

Similar Messages

  • Where can I get an aide memoir of unix commands for Terminal?

    Like the title, does anyone know where I could get an aide memoir of unix commands?

    Terminal Commands - 10
    Terminal Commands - 50
    Terminal Commands - 250
    Terminal Commands - Secrets

  • My contract is finishing, and now the operator what's to charge me 30US for unlocking the phone from the carrier. The say that it is Apple who charges them. Can this be true that that Apple want money for that?

    My contract is finishing, and now the operator what's to charge me 30US for unlocking the phone from the carrier. The say that they need to send a message to Apple and they charge them for the device to be unlocked?. Can this be true that that Apple want money for that? Or it is their lie and they don't really want to boather....

    No. Apple does not charge. It is entirely up to he carrier to set conditions and fees for unlocking.

  • Unix Command for tracing WebIntelligence Server

    Hi All,
    Please can any one tell me that what is the Unix command for tracing WebIntelligence Server. I know we use -trace parameter. But where do we use this parameter? With which script do we use it? Please give me complete command for the same.
    Thanks & Regards,
    Ani

    Hi
    Refer "To configure server tracing through the command line"  page number 207 in http://help.sap.com/businessobject/product_guides/boexir31SP3/en/xi31_sp3_bip_admin_en.pdf
    This guide is for Windows but should be same for UNIX
    Regards
    Ashiwni

  • UNIX command for Energy Saver settings - Set Schedule

    Using ARD 3, can anyone help me with a UNIX command for setting the scheduled sleep and wake times for 10.4 clients?
    Thanks,
    Josh

    Thanks for getting me on the right track, I've been working with pmset for a couple days now and I'm having some problems getting my basic schedule that I'd like to work. I'm hoping for another nudge in the right direction. Here's the scenario:
    I need the computers to wake at 7am on weekdays and to sleep at 3:30pm on weekdays as well. I've also got an addition to make the displays sleep after half an hour of inactivity, Here's what I'm trying.
    pmset repeat wake MTWRF 7:00:00;
    pmset repeat sleep MTWRF 15:30:00;
    systemsetup -setdisplaysleep 30;
    I've been trying to push this out as a batch of commands in a template which would be slick, but the problem I'm having is that the two pmset commands don't get along and whichever one is run last cancels out the other. In the actual System Prefs of the machine I'm sending the commands to, there are the two check boxes for Wake or Power On and the other for Sleep or Power Down but I can't get them both to be checked from my UNIX commands.
    Could anyone please help, I feel like I'm so close!
    Regards,
    Josh

  • ARD-Unix Command for Energy Saver Settings

    I need to take out the schedule for turning on and off 100 + iMacs. The setup was done with managed preferences in OSX server but cannot be taken off now. Is there a way to turn this off using a unix command with ARD? I've been doing one by one with ARD!

    Use ARD to send the Unix command systemsetup -help
    This will return a bunch of different commands for you to look at that are related to power and energy saving settings. Make sure you send the command as the root user
    You can always read the man files for the pmset command using your Terminal app. Also check out this page too:
    http://www.hmug.org/man/1/pmset.php

  • Send a Unix command through ARD that will change a OS X admin user to a standard user.

    I would love to send a Unix command through ARD that will change a OS X admin user to a standard user. The only thing I found close is
    sudo dscl . -delete /Groups/admin GroupMembership USERNAME
    which does remove the user from the list of admins, but they are still listed as an admin in the user preference panel, and can still use their account to authenticate for admin privileges.

    I'm not having any problems adding or removing users from the 'admin' group by using the syntax's
    dscl . -delete /Groups/admin GroupMembership ARDusername
    or
    dscl . -append /Groups/admin GroupMembership ARDusername
    What I'm saying is if a user is ticked as an Adminstrator in System Preferences and I run the
    dscl . -delete /Groups/admin GroupMembership ARDusername syntax and remove them from the 'admin' GroupMembership they still have the Administrator box ticked in System Prefs and can administer the machine.
    By the way the '/' doesn't work in the syntax in ARD.
    Thanks

  • Can this script run faster?

    Hello,
    The User dictionary does not always seem to work properly. The workaround is a script that creates discretionary hyphens for certain words.
    The following script first deletes all discretionary hyphens in a document being converted from PageMaker to InDesign. It then searches the document for 1900+ words and inserts discretionary hyphens in those words. The script has two arrays with that many elements, one for the words to be searched for, the other with the discretionary hyphens for those words. The script works fine but it takes about a minute to cycle through a 100 page document and 1900+ words.
    Is there a way to re-write this script so that it goes faster? Just curious.
    Thanks,
    Tom
    #target InDesign
    app.scriptPreferences.version = 5.0;
    var myDoc = app.activeDocument;
    var discrecHyphen = theGrepChanger(myDoc,"~-","");    
    if(discrecHyphen.length > 0){
         alert("I just deleted "+discrecHyphen.length+" discretionary hyphens.");
         }//end if
    else{
         alert("There were no discretionary hyphens in this document.");
         }//end else
    var countWords = 0;
    var numWords = "";
    var wordsChanged = [];
    var arrRawWords = ["humongous","array","of","thousand-plus","elements"];
    var arrHyphenWords = ["hu~-mon~-gous","ar~-ray","of","thousand-~-plus","el~-e~-ments"];
    for(var i =0; arrRawWords.length > i;i++){
         var numWords = theGrepChanger(myDoc,arrRawWords[i],arrHyphenWords[i]);
              if(numWords.length!=0){
                   wordsChanged.push(arrRawWords[i]);
                   }//end if
              countWords +=numWords.length;    
         }//end for i
    alert ("I just added discretionary hyphens for " +countWords+" words.\r\rSweet, huh?!");
    //*****functions*******
    function theGrepChanger(docRef,grepFindIt,grepChangeIt){
         app.findGrepPreferences = NothingEnum.NOTHING;
         app.changeGrepPreferences = NothingEnum.NOTHING;
         app.findGrepPreferences.findWhat = grepFindIt;
         app.changeGrepPreferences.changeTo = grepChangeIt;
         var arrGrepFindIt = myDoc.changeGrep();
         return arrGrepFindIt;
    }//end theGrepChanger

    OK, it's not the arrays. If you turn on the ESTK's profiler, you get this data:
    Line
    Time
    Hits
    1
    1
    1
    4
    6
    1
    5
    1939
    1
    6
    183
    1
    7
    5
    1
    16
    1
    1
    17
    1
    1
    18
    14
    1
    37
    389785
    1901
    38
    1981085
    1901
    39
    2692741
    1901
    40
    1197758
    1901
    41
    1132369
    1901
    42
    38969087
    1901
    43
    2165
    1901
    44
    1741
    1901
    45
    9
    2
    I wrapped your script in a function() {} to see if it would report times in the array lookups, so it doesn't. Perhaps it's being optimized out. Anyhow, it spends all the time in line 42, which is the mydoc.changeGrep(). Oh, the document -- I placed Alice in Wonderland in 12pt Minion Pro Regular on 5.5"x8.5" pages, and then used as my raw words the first 1900 words in /usr/share/dict/words and as their hyphenation pairs inserted a ~ after every letter 'c'. Takes about 46 seconds to run.
    You might also think it'd run faster if you opened the document with app.open(File("alice.indd",false) so it shows no window. This seems sort of true, but then ID crashes on the 872nd word ("accept", hyphed as "ac~c~ept"), probably one of the few words in my hyphenation list that actually shows up in Alice. Oh well... It also doesn't seem much faster -- takes about 20 seconds to get to 872, which seems about the same time as with the window open.

  • Which unix command for converting xml to pdf

    Anybody know the command in unix to convert docbook xml to PDF???
    is it xsltproc or pdfwrite???
    thanx

    "ooba" <[email protected]> wrote in message
    news:gl2klg$rap$[email protected]..
    >I know this is the Flex Group, but I'm getting no love
    from the Flash
    >group.
    > 1. I need to build a thick client
    > 2. I have 0 experience with Flex or AIR
    > 3. I have built alot of Flash web components and a few
    thick clients
    > 4. I only have one week to get something working
    >
    > Can anyone tell me if it is even possible for Flash to
    generate a PDF file
    > from an imported XML file? or to browse a systems and
    allow the user to
    > select
    > an xml file to load?
    You'd need to upload the file to a server and have the server
    do this.
    > I need to have the client select an xml file that and
    the thick client
    > would
    > then use a predefined xsl file and (missing this part)
    need to convert the
    > xml
    > out to a human readable PDF format.
    Depending on what server-side technology you are using, there
    are probably
    PDF libraries you could use.
    > If you have another suggestion on how to do this please
    post suggestions.
    >
    > All I know right now is that I need to construct a thick
    client to do
    > this,
    > and being that Flash has been what I have built thick
    clients on before
    > I'd
    > like to do it in Flash rather than try and figure out
    how to do it in C#
    > .Net
    > in less than a week.
    You won't be able to do it with Flash or Flex alone.
    HTH;
    Amy

  • Does anyone know the apple script or unix command in ARD that allows me to send keystroke commands to computers on my ARD network ? thanks !

    I am trying to cue computers through keystroke commands using ARD
    I want to know a unix shell or script command to hit keystrokes on my ARD machines.
    EXAMPLE... I want machine X  to press the letter K.
    I am also wondering if you can send multiple commands doing this , multiple keystrokes with built in delays
    Thank you

    Welcome,
    I use the "System Events" handler, e.g.:
              tell application "System Events" to delay 5.5
              tell application "System Events" to keystroke "K"
              tell application "System Events" to delay 0.5
              tell application "System Events" to keystroke return
    Regards,
    Shawn

  • Using Sent Unix Command in ARD 3 with proxy authentication

    I'd like to use Unix commands to update Apple software through ARD thus allowing me to lock the computer screen before the process using the ARD command to do so, thus keeping the users from interfering with the process .
    Our network utilizes password protected firewall proxy that hangs ARD when using the softwareupdate command through ARD's "Send Unix Command..." at the point in which it would ask for authentication if using the same command in the terminal.
    Is there a Unix/terminal script or a series of script commands that could be modified to wait and enter the appropriate authentication at the previous mentioned prompt?
    I've researched this topic on this forum and discover a few post that states it is not possible but they are fairly old posts so I am hoping ARD 3 has some scripts or commands that can pass thru a username and password

    Welcome,
    I use the "System Events" handler, e.g.:
              tell application "System Events" to delay 5.5
              tell application "System Events" to keystroke "K"
              tell application "System Events" to delay 0.5
              tell application "System Events" to keystroke return
    Regards,
    Shawn

  • UNIX command for terminal

    Here is what I want to do:
    I want to send the terminal command to 25 laptops all at once to direct them to our internal server for software update.
    I know how to log in to all of the machines at once.
    osascript -e 'tell application "System Events"' -e 'keystroke "username"' -e 'keystroke tab' \
    -e 'delay 0.5' -e 'keystroke "password"' -e 'delay 0.5' -e 'keystroke return' -e 'end tell'
    I know how to open terminal.
    open -a terminal
    Now what I want to know is how to have it type this in for me:
    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURLhttp://SERVER.local:8088/index-mountainlion-lion-snowleopard-leopard.merged-1.su catalog
    Then have a pause and then type my password.
    Bonus points for then a script to force it to check for and do the update.

    You don't need to use send unix command to send osascript to login, and then open the terminal to then type in a termainl command.
    you can just do
    send unix command
    as user root
    defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURLhttp://SERVER.local:8088/index-mountainlion-lion-snowleopard-leopard.merged-1.su catalog

  • Unix commandlines for ARD

    I am looking for some help using ?Unix command lines and shell scripts with ARD. Is this the best forum for that....for example I am trying to start an ASR server remotely from ARD on a OS X.4 server...When I drag the script to terminal and start it using SUDO the server starts up and gives me the information it is waiting for client....however if I call the script using the following from ARD"/Users/admin/Desktop/MulticastConfig/ASRmulticastBiolab.sh" using ROOT as the logged in person I do not get feed back from the Unix window and the task just keeps running. When go to to the server and check Activity Monitor I see ASR running as a process. What really bothers me is that 1) I don't get the "waiting for clients message" and I cannot run any other tasks. Is there a way to have the process run from ARD just like I was at the server. If I stop the task it kills ASR....it seems as if the process is hooked into ARD until I kill the task....Which is not what I want to do....I have many questions about the unix command line and ARD so if someone could point me in the right direction I would appreciate it....
    Thanks

    I agree with Dave. The reason the "Send Unix Command" is in ARD, is so that you can send a command line to a group of Macs and you don't have to go around to each one and type in the command to each one of them. This comes in handy in a lab environment when you have to turn off something like DeepFreeze on all the computers.
    For one machine, like the server, you are much better off just running SSH.

  • Unix command in ARD to remove DNS Servers from Network prefs?

    I need to know how to send a unix command to remove DNS Servers in Network preferences. I need the DNS Servers field to be blank. Can this be done?

    Our network administrator is getting ready to change the IP address of our DNS server. This means I have over 30 Macs that will be needing changes to their DNS settings. Since each machine is setup with limited access to the system prefs, that means I have to go to each machine and log in as the admin user to make this change. In the interest of saving time, is this something I can do with Remote Desktop and how? Would I use the same commands in this post and replace dns1 with our DNS' new IP address? Will this distrupt the users access to the network when I do so?
    Thanks for any help.
    Beth

  • Error message when using one of the built in unix commands for software upd

    I have RD3 admin software installed on my dedicated admin power mac and I have a test power mac machine on my local network. I can install packages fine using the package installer, however whenever i use the built in unix commands to list available updates on that target machinie, download available updates, or install available updates, i get the following error, any clues? ive tried running as current logged on user option, and the ARD User account I created on the machine, I can observe, control, curtain everything else, just these unix commands fail.
    Error NSURLErrorDomain -1100
    Software Update Tool
    Copyright 2002-2005 Apple
    mac mini   Mac OS X (10.4.3)  

    Check to make sure that the command is running as root. The template should enter that automatically, but try again and make sure it does.
    Hope this helps.

Maybe you are looking for