@Mouthbaten_1911 Here is a script I created to deploy TeamViewer Host via Self Service or at enrollment. We push out PPPC config profiles to allow Accessibility and SystemPolicyAllFiles. User still needs to enable screen sharing. I find it works better than the other deployment guides as it will always push out the latest version... I have scrubbed the IDC, API token and computer name schema we use. but you can plug in yours from your TV management gui (or from parts of their guide. Also I made the custom ID as parameter 7 which will need to be entered when deploying the script.
#!/bin/zsh
function logmessage() {
if [ $? = 0 ] ; then
echo "$1"
else
echo "$2"
echo "Aborting script"
cleanup
exit 1
fi
}
function cleanup() {
/bin/rm -Rf "$tempDirectory"
logmessage "Removed temporary items." "Failed removing temporary items."
/bin/rm -f "/Library/Application Support/JAMF/Waiting Room/TeamViewerHost-id********.pkg" && /bin/rm -Rf "/Library/Application Support/JAMF/Waiting Room/TeamViewerHost-id********.pkg.cache.xml"
logmessage "Removed TeamViewer Host package and supporting files from Jamf Waiting Room." "Failed Removing TeamViewer Host package and supporting files from Jamf Waiting Room."
}
choicesXML='<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerPriviledgedHelper</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerPriviledgedHelper</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerPriviledgedHelper</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhost</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhost</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhost</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostAgent</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostAgent</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostAgent</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostRestarter</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostRestarter</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostRestarter</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAuthPlugin</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAuthPlugin</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAuthPlugin</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemotePrinting</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemotePrinting</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>0</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemotePrinting</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemoteAudioDriver</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemoteAudioDriver</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemoteAudioDriver</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostSilentInstaller</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostSilentInstaller</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerhostSilentInstaller</string>
</dict>
</array>
</plist>'
# create temporary working directory
workDirectory=$( /usr/bin/basename $0 )
tempDirectory=$( /usr/bin/mktemp -d "/private/tmp/$workDirectory.XXXXXX" )
logmessage "Created working directory '$tempDirectory'." "Failed to create working directory '$tempDirectory'."
# change directory to temporary working directory
cd "$tempDirectory"
logmessage "Changed directory to working directory '$tempDirectory'." "Failed to change directory to working directory '$tempDirectory'."
echo "$choicesXML" > "$tempDirectory/choices.xml"
logmessage "Created choices.xml file in '$tempDirectory'." "Created choices.xml file in '$tempDirectory'."
#Download and Install custom host
echo "Downloading and Installing TeamViewer custom host..."
waitingroomDirectory=$( mkdir "/Library/Application Support/JAMF/Waiting Room" )
cd "/Library/Application Support/JAMF/Waiting Room"
curl -L https://download.teamviewer.com/download/version_15x/CustomDesign/Install%20TeamViewerHost-$7.pkg -o "/Library/Application Support/JAMF/Waiting Room/TeamViewerHost-$7.pkg"
/usr/sbin/installer -pkg "/Library/Application Support/JAMF/Waiting Room/TeamViewerHost-id********.pkg" -applyChoiceChangesXML "$tempDirectory/choices.xml" -target /
cleanup
sleep 20
SERIAL=`ioreg -l | awk '/IOPlatformSerialNumber/ { print $4;}' | sed -e 's/^\\"//' -e 's/"$//'`
/Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token ********************** -group Host_DeviceGroup -alias COMPUTER_NAME_GOES_HERE -grant-easy-access
exit 0 here is the script for Teamviewer full
#!/bin/zsh
function logmessage() {
if [ $? = 0 ] ; then
echo "$1"
else
echo "$2"
echo "Aborting script"
cleanup
exit 1
fi
}
function cleanup() {
/bin/rm -Rf "$tempDirectory"
logmessage "Removed temporary items." "Failed removing temporary items."
/bin/rm -Rf "/Library/Application Support/JAMF/Waiting Room/"
logmessage "Removed TeamViewer package and supporting files from Jamf Waiting Room." "Failed Removing TeamViewer package and supporting files from Jamf Waiting Room."
}
choicesXML='<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerPriviledgedHelper</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerPriviledgedHelper</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerPriviledgedHelper</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewer</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewer</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewer</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAgent</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAgent</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAgent</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRestarter</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRestarter</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRestarter</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAuthPlugin</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAuthPlugin</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerAuthPlugin</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemotePrinting</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemotePrinting</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>0</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemotePrinting</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemoteAudioDriver</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemoteAudioDriver</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerRemoteAudioDriver</string>
</dict>
<dict>
<key>attributeSetting</key>
<false/>
<key>choiceAttribute</key>
<string>visible</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerSilentInstaller</string>
</dict>
<dict>
<key>attributeSetting</key>
<true/>
<key>choiceAttribute</key>
<string>enabled</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerSilentInstaller</string>
</dict>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
<string>com.teamviewer.teamviewerSilentInstaller</string>
</dict>
</array>
</plist>'
# create temporary working directory
workDirectory=$( /usr/bin/basename $0 )
tempDirectory=$( /usr/bin/mktemp -d "/private/tmp/$workDirectory.XXXXXX" )
logmessage "Created working directory '$tempDirectory'." "Failed to create working directory '$tempDirectory'."
# change directory to temporary working directory
cd "$tempDirectory"
logmessage "Changed directory to working directory '$tempDirectory'." "Failed to change directory to working directory '$tempDirectory'."
echo "$choicesXML" > "$tempDirectory/choices.xml"
logmessage "Created choices.xml file in '$tempDirectory'." "Created choices.xml file in '$tempDirectory'."
#Download and Install custom
echo "Downloading and Installing TeamViewer custom..."
waitingroomDirectory=$( mkdir "/Library/Application Support/JAMF/Waiting Room" )
cd "/Library/Application Support/JAMF/Waiting Room"
curl -L https://download.teamviewer.com/download/version_15x/CustomDesign/Install%20TeamViewer-$7.pkg -o "/Library/Application Support/JAMF/Waiting Room/TeamViewerFull-$7.pkg"
/usr/sbin/installer -pkg "/Library/Application Support/JAMF/Waiting Room/TeamViewerFull-id********.pkg" -applyChoiceChangesXML "$tempDirectory/choices.xml" -target /
logmessage "Installed TeamViewer package with choices." "Failed to install TeamViewer package with choices."
cleanup
sleep 30
SERIAL=`ioreg -l | awk '/IOPlatformSerialNumber/ { print $4;}' | sed -e 's/^\\"//' -e 's/"$//'`
/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token ****************** -group AdminFullClientGroup -alias COMPUTER_NAME_HERE
#/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Assignment -api-token ****************** -reassign -group AdminFullClientGroup -alias COMPUTER_NAME_HERE
exit 0