What's New

Useful Apple Remote Desktop Unix Commands

Apple Remote Desktop

ARD  is the best way to manage the Mac computers on your network. Distribute software, provide real-time online help to end users, create detailed software and hardware reports, and automate routine management tasks — all without leaving your desk.  Here is a list of Unix commands that you could send: If this post helped you, PLEASE take the time to +1 it.

Unix Commands – use at your own risk

Open and Close a CD Tray drutil tray open
drutil tray close
Repair Permissions of drive diskutil repairPermissions /
Retrive SMART Drive Status diskutil info disk0 | grep SMART
Run “daily” script periodic daily
Run as “root” user
Run “weekly” script periodic weekly
Run as “root” user
Run “monthly” script periodic monthly
Run as “root” user
Update Prebindings update_prebinding -root / -force
Run as “root” user
Set System Volume osascript -e “set volume 100” – Options are from 0 to 100
osascript -e “set output muted true” – changes the muted stats
osascript -e “set volume output volume 80 muted false” – you can combine options
Check Battery Cycle Count ioreg -l | grep Capacity – 10.3.8 or higher
networksetup networksetup -help
systemsetup systemsetup -help
airport –scan /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport –scan
airport –getinfo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport –getinfo
airport –showstack /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport –showstack
Spotlight Serach – 10.4+ only mdfind pdf – change “pdf” to the file extention you wish to find.
Show a list of users who have logged in last
Set Software Update Server Address:
This is a per user setting.
defaults write com.apple.SoftwareUpdate CatalogURL http://xxx.xxx.com:8088/index.sucatalog
Remote GUI login via Apple Remote Desktop: osascript -e ‘tell application “System Events” to keystroke “LOGIN_NAME”‘; \
osascript -e ‘tell application “System Events” to keystroke tab’; \
osascript -e ‘tell application “System Events” to delay 0.5’; \
osascript -e ‘tell application “System Events” to keystroke “PASSWORDHERE”‘; \
osascript -e ‘tell application “System Events” to delay 0.5’; \
osascript -e ‘tell application “System Events” to keystroke return’Replace LOGIN_NAME and PASSWORD with the proper values
Run as “root” user
Change a local users password: dscl . -passwd /Users/user_name new_password
Run as “root” user
Run Software Updates Remotely softwareupdate -i -a
Run as “root” user
View all running applications osascript -e ‘tell application “Finder” to get name of every process whose visible is true’
Flush MCX Cache
For 10.4.x
rm -r /Library/Managed\ Preferences/*
/System/Library/CoreServices/mcxd.app/Contents/Resources/MCXCacher -f
Run as “root” user
Flush MCX Cache
For 10.2-10.3
/usr/bin/nicl -t 127.0.0.1/local -delete /mcx_cache
Run as “root” user
Quit Application killall Application-Name
Login as user osascript <<EndOfMyScripttell application “System Events”keystroke “test1″keystroke return

delay 3.0

keystroke “test1”

delay 3.0

keystroke tab

keystroke return

keystroke return

end tell

EndOfMyScript

Fun Commands – use at your own risk
Make Computer Speak Say “Your Text Here”
Computer Speaks Current Date osascript <<EOF
say (current date) as string using “Cellos”
EOF
Optical Tray Wave Script for i in 1 2 3 4 5; do
drutil tray open
sleep 1
drutil tray close
sleep 1
done
Machines sing the list of software updates. osascript <<EOF
set suList to (do shell script “softwareupdate -l”) as string
say suList using “Cellos”
EOF
About BjTechNews (1061 Articles)
An IT guy trying to learn everything about technology and sharing it with you all. I'm a blogger and video blogger who highlights daily news in the tech industry, promoting tips and hacks for fellow techies.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: