Hey Guys,
Im doing it all wrong again (or must be)
I have setup a policy to run once per user at login to run the below script. It works for say me when i login to my own pc, However when I login to another pc it does not run as I think the policy thinks that it only needs to run 1x per user in total rather than 1x per user per machine
How do i create a login script using casper that will run 1x per user no matter how many machines i login to... I have a couple of scripts to run this way
Office Configuration for logged in User
#!/bin/bash
echo "Setting Up Office for logged in User"
/usr/libexec/PlistBuddy -c "set 14\\\\UserInfo\\\\UserName $3" /Users/$3/Library/Preferences/com.microsoft.office.plist
UserName=$3
FirstName=`dscl /Active Directory/AUTUNI/All Domains -read /Users/$3 FirstName | sed 's/FirstName://'`
LastName=`dscl /Active Directory/AUTUNI/All Domains -read /Users/$3 LastName | sed 's/LastName://'`
FullName=`dscl /Active Directory/AUTUNI/All Domains -read /Users/$3 RealName | sed 's/RealName://'`
Initial1="$(echo $FirstName | head -c 1)"
Initial2="$(echo $LastName | head -c 1)"
Initial="$Initial1""$Initial2"
CompanyType="AUT University"
/usr/libexec/PlistBuddy -c "set First Name $FirstName" /Users/$3/Library/Application Support/Microsoft/Office/MeContact.plist
/usr/libexec/PlistBuddy -c "set Last Name $LastName" /Users/$3/Library/Application Support/Microsoft/Office/MeContact.plist
/usr/libexec/PlistBuddy -c "set Name $FullName" /Users/$3/Library/Application Support/Microsoft/Office/MeContact.plist
/usr/libexec/PlistBuddy -c "set Initials $Initial" /Users/$3/Library/Application Support/Microsoft/Office/MeContact.plist
/usr/libexec/PlistBuddy -c "set Business Company $CompanyType" /Users/$3/Library/Application Support/Microsoft/Office/MeContact.plist
exit 0
And adding the user to the admin group (targeted to laptops, staff user accounts) So when the AD staff user is offsite they have Full Admin rights. this again I want to run 1x per user but for that specific user on several machines.
#!/bin/sh
dscl . append /Groups/admin GroupMembership $3
exit 0
Also it seems that i just reimaged my machine here and the script has not run again so even though it has a new image on the device as the policy is user based it thinks it already has run...