what am i doing wrong?

Not applicable

Hi all - I'm new to all this scripting stuff, so please forgive my questions.. If I input all the office preference keys that i got from the office4mac site - and i put them all in a single script - then i run that script in terminal, will it modify all the desired preferences? Because i ran the script in my terminal & I got no errors. - And when i checked the actual plist file - nothing seemed to change.
i attached the script that im using..... what am i doing wrong?

#!/bin/sh
#ALL_OFFICE_POLICIES

#Suppresses first run windows. Only prompts user for needed information like a O365 authentication
defaults write com.microsoft.office OfficeAutoSignIn -bool TRUE

#Sets Office theme: 0 - Colorful, 1 - Classic
defaults write com.microsoft.office kCUIThemePreferencesThemeKeyPath -int 1

#"Sets value of 'Belongs to' field in the About Box.
defaults write com.microsoft.office OfficeActivationEmailAddress -string "PVHCORP"

#When set to true will force the open/save panel to ‘On my Mac’ instead of 'Online Locations'
defaults write com.microsoft.office DefaultsToLocalOpenSave -bool TRUE

#Disables the gallery view on application launch.
defaults write com.microsoft.office ShowDocStageOnLaunch -bool FALSE

#remove all future "What's new" messages for all suite apps: Word, PowerPoint, Excel, Outlook, and OneNote.
defaults write com.microsoft.office ShowWhatsNewOnLaunch -bool FALSE

#EXCEL_APP_POLICIES

#"This will prevent user from signing in to any O365 service. 0 - all accounts allowed; 1 - prevent institutional accounts; 2 - prevent MSA (personal) accounts; 4 - no accounts allowed to sign in"
defaults write com.microsoft.Excel SignInOptions -int 4

exit 0
1 ACCEPTED SOLUTION

talkingmoose
Moderator
Moderator

@vferra, I agree with @mahughe that a configuration profile would be easier to manage these settings.

The reason your script returned no errors when running in Terminal but doesn't work when running via Jamf is that it's written to run as the current logged in user. Jamf will run the script as the root user. It's probably working. It's just not working the way you want.

Do this to take what you've done so far and convert it to configuration profiles:

  1. Take each command of your script and modify it to write the plist to your Desktop. Change: defaults write com.microsoft.office OfficeAutoSignIn -bool TRUE to defaults write ~/Desktop/com.microsoft.office.plist OfficeAutoSignIn -bool TRUE.

  2. Now, you should have a single com.microsoft.office.plist file on your desktop. Select it and tap the spacebar to view it with QuickLook. You should see each of the key/value pairs from running your commands. 8f55f9bdef4e4f6985f3143bc95f62d9

  3. Next, convert that plist to a format Jamf Pro can read: /usr/bin/plutil -convert xml1 ~/Desktop/com.microsoft.office.plist You won't see much in the Terminal. If it doesn't report an error, then it worked.

  4. In Jamf Pro, go to Computers > Configuration Profiles and start a new configuration profile. Name it something like "Microsoft Office 2016 Preferences".

  5. Scroll down in the list of payloads in the middle and locate the Custom Settings payload. Click the Configure button.

  6. From the dropdown menu, upload the com.microsoft.office.plist file from your desktop. Note that it will automatically fill the domain name with "com.microsoft.office". This is correct. bc10f68f90494263b00703616ded54d5

  7. Save and deploy to a test Mac. Or click the Download button at the bottom of your newly saved configuration profile to get a .mobileconfig file. If it doesn't try to install automatically, double-click it. It will ask you to install it in System Preferences > Profiles. This is a quick way to test rather than having to scope a computer.

View solution in original post

6 REPLIES 6

mahughe
Contributor

Try putting them into a configuration profile might be easier. Look up talkingmoose he has a blog filled with office info.

talkingmoose
Moderator
Moderator

@vferra, I agree with @mahughe that a configuration profile would be easier to manage these settings.

The reason your script returned no errors when running in Terminal but doesn't work when running via Jamf is that it's written to run as the current logged in user. Jamf will run the script as the root user. It's probably working. It's just not working the way you want.

Do this to take what you've done so far and convert it to configuration profiles:

  1. Take each command of your script and modify it to write the plist to your Desktop. Change: defaults write com.microsoft.office OfficeAutoSignIn -bool TRUE to defaults write ~/Desktop/com.microsoft.office.plist OfficeAutoSignIn -bool TRUE.

  2. Now, you should have a single com.microsoft.office.plist file on your desktop. Select it and tap the spacebar to view it with QuickLook. You should see each of the key/value pairs from running your commands. 8f55f9bdef4e4f6985f3143bc95f62d9

  3. Next, convert that plist to a format Jamf Pro can read: /usr/bin/plutil -convert xml1 ~/Desktop/com.microsoft.office.plist You won't see much in the Terminal. If it doesn't report an error, then it worked.

  4. In Jamf Pro, go to Computers > Configuration Profiles and start a new configuration profile. Name it something like "Microsoft Office 2016 Preferences".

  5. Scroll down in the list of payloads in the middle and locate the Custom Settings payload. Click the Configure button.

  6. From the dropdown menu, upload the com.microsoft.office.plist file from your desktop. Note that it will automatically fill the domain name with "com.microsoft.office". This is correct. bc10f68f90494263b00703616ded54d5

  7. Save and deploy to a test Mac. Or click the Download button at the bottom of your newly saved configuration profile to get a .mobileconfig file. If it doesn't try to install automatically, double-click it. It will ask you to install it in System Preferences > Profiles. This is a quick way to test rather than having to scope a computer.

Not applicable

@talkingmoose you sir... are thee best ........ million thanks for this...
exactly what i was looking for....

Not applicable

@talkingmoose when i try to convert it.....i get the following error:
8fe24573b34c4e588be848fe13980e3e

any ideas?

Not applicable

i

Not applicable

@talkingmoose Please disregard my previous questions....i got it
i skipped a step by mistake

sorry for the trouble...