From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin...
Transcript of From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin...
![Page 1: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/1.jpg)
MacSysAdmin 2010Charles Edge
From the Wizard’s Hat
Wednesday, October 6, 2010
![Page 2: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/2.jpg)
Automated Binding
Wednesday, October 6, 2010
![Page 3: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/3.jpg)
Environment Variables• printenv
• $HOME
• $GROUPS
• $USER
• $HOSTNAME
• $LANG
Wednesday, October 6, 2010
![Page 4: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/4.jpg)
scutil --get HostName vs. $HOSTNAME
Wednesday, October 6, 2010
![Page 5: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/5.jpg)
OpenLDAP
• dsconfigldap -f -a openldap.krypted.com -c $HOSTNAME -u diradmin -p PASSWORD -v
• sleep 30
• dscl /Search -create / SearchPolicy CSPSearchPath
• dscl /Search -append / CSPSearchPath /LDAPv3/openldap.krypted.com
Wednesday, October 6, 2010
![Page 6: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/6.jpg)
Active Directorydsconfigad -a $HOSTNAME -u arek -p apple -ou "ou=Macs,ou=Computers,dc=KRYPTED,dc=COM" -domain KRYPTED.com
sleep 30
dsconfigad -lu arek -lp apple -groups "KRYPTED\domain admins" -mobile enable -mobileconfirm disable
Wednesday, October 6, 2010
![Page 7: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/7.jpg)
Don’t Forget About CSPSearchPath
• dscl /Search -create / SearchPolicy CSPSearchPath
• dscl /Search -append / CSPSearchPath “/Active Directory/KRYPTED.com”
Wednesday, October 6, 2010
![Page 8: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/8.jpg)
Create Packages from CLI Part Deux
• packagemaker --doc /My/project.pmdoc --version 2.0 --title 'Duncan May Laugh At You'
• Be careful not to change items from faux root
• Permissions
Wednesday, October 6, 2010
![Page 9: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/9.jpg)
transmogrifier.sourceforge.net
Wednesday, October 6, 2010
![Page 10: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/10.jpg)
sabackup.sourceforge.net
Wednesday, October 6, 2010
![Page 11: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/11.jpg)
Open Directory Backup
Wednesday, October 6, 2010
![Page 12: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/12.jpg)
http://techjournal.318.com/scripts/open-
directory-auto-archiver/
Wednesday, October 6, 2010
![Page 13: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/13.jpg)
iSCSIhttp://krypted.com/
mac-os-x/how-to-use-iscsi-on-mac-os-x/
Wednesday, October 6, 2010
![Page 14: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/14.jpg)
Converting Monolithic Images to Packages
Wednesday, October 6, 2010
![Page 15: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/15.jpg)
Converting Monolithic Images to Packages
Composer by JAMF
Wednesday, October 6, 2010
![Page 16: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/16.jpg)
Integrating w/ Help Desk Software
• Username and Password known?
• IP or hostname known?
• send shell command:
• open vnc://USER:PASSWORD@HOSTNAME
• No ARD Required
Wednesday, October 6, 2010
![Page 17: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/17.jpg)
Scripting Excersizes
Wednesday, October 6, 2010
![Page 18: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/18.jpg)
Wednesday, October 6, 2010
![Page 19: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/19.jpg)
Can You Assume the GUID for a User is a
Constant?
Wednesday, October 6, 2010
![Page 20: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/20.jpg)
Password Swap
Wednesday, October 6, 2010
![Page 21: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/21.jpg)
Wednesday, October 6, 2010
![Page 22: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/22.jpg)
Wednesday, October 6, 2010
![Page 23: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/23.jpg)
Wednesday, October 6, 2010
![Page 24: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/24.jpg)
Get Information from dscl w/out defaults• Constrain for Certain Character Locations
• dscl . read /Users/admin | grep GeneratedUID | cut -c 15-51
• Constrain for Certain Fields
• dscl . read /Users/admin | grep GeneratedUID | awk '{print $2}'
Wednesday, October 6, 2010
![Page 25: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/25.jpg)
Variable
GUID=$(dscl . read /Users/cedge | grep GeneratedUID | awk '{print $2}')
curl http://www.krypted.com/Scripts/password > /var/db/shadow/hash/$GUID
#echo $GUID
Wednesday, October 6, 2010
![Page 26: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/26.jpg)
Mission:Automated RSS Reader
Wednesday, October 6, 2010
![Page 27: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/27.jpg)
Create An Array
cities=( losangeles dallas seattle portland sandiego minneapolis)
for city in ${cities[@]}
do
echo $city
done
Wednesday, October 6, 2010
![Page 28: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/28.jpg)
Using Curl To Read RSS
• Find the rss URL
• curl --silent "http://${city}.craigslist.org/search/cpg?query=Shelf&catAbbreviation=cpg&addThree=&format=rss"
• Constrain output
Wednesday, October 6, 2010
![Page 29: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/29.jpg)
Constraining with Regex
• Find Subject Manually In Curl
• | grep "item rdf:about="
• | cut -c 18-100 | sed -e "s/\"//g" | sed -e "s/\>//g"
• >> /tmp/temp.txt
Wednesday, October 6, 2010
![Page 30: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/30.jpg)
For Loop
• Build further loops
• Open in Safari
• Read All The Loops
• while read line; do open "$line"; done < /tmp/temp.txt
Wednesday, October 6, 2010
![Page 31: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/31.jpg)
PubSub?ATOM?
Wednesday, October 6, 2010
![Page 32: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/32.jpg)
Finding Users and Groups
Wednesday, October 6, 2010
![Page 33: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/33.jpg)
Find All of the Groups
for GROUP_NAME in `dscl . -list /Groups` ; do
echo "$GROUP_NAME"
done
Wednesday, October 6, 2010
![Page 34: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/34.jpg)
And Users...
for USER_NAME in `dscl . -list /Users` ; do echo "$USER_NAME"; done
Wednesday, October 6, 2010
![Page 35: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/35.jpg)
Fix Home Folder Permissions
Wednesday, October 6, 2010
![Page 36: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/36.jpg)
Fix Home Folder Permissions
for USERHOME in "$1"* ; do
declare USER_NAME="$($basename "$USERHOME")"
if [ -d "$USERHOME/Library" ] ; then
$chown -R "$USER_NAME" "$USERHOME"
cp -r /System/Library/User\ Template/English.lproj/* $USERHOME
fi
Wednesday, October 6, 2010
![Page 37: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/37.jpg)
Polymorphism
Wednesday, October 6, 2010
![Page 38: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/38.jpg)
Self Updating Scripts
#!/bin/bashURL=”http://www.krypted.com/Scripts/randomsus.sh”PATH=”/Scripts/randomsus.sh”/usr/bin/curl $URL > $PATHexit 0
Wednesday, October 6, 2010
![Page 39: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/39.jpg)
Bringing Data In
Wednesday, October 6, 2010
![Page 40: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/40.jpg)
Positional Parameters
• Some commands have their own:
• installer
• jamf
• Use $1, $2, $3, etc in scripts
• Run script w/ command:
• echo $1
Wednesday, October 6, 2010
![Page 41: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/41.jpg)
Input to Scriptx=$1
while [ $x -lt 100000000 ]
do
open http://SOMEWEBSITE.COM/module.php?mod=network\&op=makevirtualmachine\&uid=$x
sleep 3
automator /Users/cedge/Desktop/Click.workflow
sleep 3
killall Safari
x=`expr $x - 1`
done
Wednesday, October 6, 2010
![Page 42: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/42.jpg)
Making Operators
Wednesday, October 6, 2010
![Page 43: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/43.jpg)
GetoptsMaking Operators
Wednesday, October 6, 2010
![Page 44: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/44.jpg)
Getoptswhile getopts Ci:ukvn:N: SWITCH ; do case $SWITCH in v ) export LOGLEVEL="VERBOSE" ;; C ) export ENABLECOLOR="YES" ;; u ) export GUI="ENABLED" ;; N ) export CLI_NAME_FORMAT="${OPTARG}" ;; n ) export CLI_CUSTOM_NAME="${OPTARG}" ;; k ) export KEEP_CURRENT_NAME='YES' ;; i ) export OVERRIDEIP="${OPTARG}" ; [ "${#OVERRIDEIP}" -gt 0 ] || ([[ "$OVERRIDEIP" = -* ]] && die "GETOPTS" "IP addess not specified" 1);; esacdone
Wednesday, October 6, 2010
![Page 45: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/45.jpg)
GUI Wrapping My Pretties
Wednesday, October 6, 2010
![Page 46: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/46.jpg)
• AppleScript
• do shell script "asr -source" & space & posix_dmgfile & space & "-server /tmp/asr.plist" with administrator privileges
• .command
• Save script w/ .command instead of .sh
Wednesday, October 6, 2010
![Page 47: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/47.jpg)
Mobile Home Creation
Wednesday, October 6, 2010
![Page 48: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/48.jpg)
VBS?Set objFSO = CreateObject("Scripting.FileSystemObject")Set objNetwork = CreateObject("WScript.Network")
Set colItems = GetObject _ ("LDAP://ou=Users,dc=318,dc=com")colItems.Filter = Array("User")
'On error resume next
For Each objItem in colItems strUser = objItem.sAMAccountName strDest = "\\afp03.318.com\homes\" & strUser Set objFSO = CREATEOBJECT("Scripting.FileSystemObject") IF Not objFSO.FolderExists(strDest) THEN Set objFolder = objFSO.CreateFolder(strDest) strDest = "\\afp03.318.com\homes\" & strUser Set objShell = CreateObject("Wscript.Shell") objShell.Run ("\\\\afp03.318.com\netlogon\\SetACL.exe -on """ & strDest & """ -ot file -actn ace " & "-ace ""n:AD\" & strUser & ";p:full""") 'cacls to be used in the future (instead of setacl.exe) ELSE END IFNext
Wednesday, October 6, 2010
![Page 49: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/49.jpg)
Regression Testing
Wednesday, October 6, 2010
![Page 50: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/50.jpg)
Regression TestingEggplant from TestPlant
Wednesday, October 6, 2010
![Page 51: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/51.jpg)
Find and Change
• Package Maker
• diff --side-by-side <ORIGINAL> <NEW>
• Change contents of file
Wednesday, October 6, 2010
![Page 52: From the Wizard’s Hatdocs.macsysadmin.se/2010/pdfs/MacSysAdmin2010WizardsHat.pdf · MacSysAdmin 2010 Charles Edge From the Wizard’s Hat Wednesday, October 6, 2010](https://reader034.fdocuments.net/reader034/viewer/2022042416/5f31dbb42da1642e3a278a55/html5/thumbnails/52.jpg)
ARD Templates
Wednesday, October 6, 2010