/build/static/layout/Breadcrumb_cap_w.png

Kace - deploy Microsoft templates to MAC via Dell Kace 1000

Hi everyone,

I`m trying to deploy Microsoft Word templates through K1000.
The problem i have is that i can copy the template file to the Kace download/packages folder with the built in script function.
From there i want to copy the Template.docm file to 

"Users/"username"/Library/Application Support/Microsoft/Office/User Templates/"

I have tried to run a copy.sh script with the cp command to the specified folder. But im not able to copy the file as root user since the destination is in the Users/currentuser/Library and root user doesnt have the rights to the folder.
I have also tried with sudo chmod +x to give the root user acees to the folder and then copy the file but with the same result.

Tried my script directly on the mac where it works perfectly since im logged in with the user himself.
So is there a way to run the script with the currently logged in user?

here is my script, im not really strong in scripting so please bear with me:

#!/bin/sh

sudo chmod +x "~/Library/Application Support/Microsoft/Office/User Templates"

cp "~/Library/Application Support/Dell/KACE/data/kbots_cache/packages/kbots/59/Template.docm" "Users/$LOGNAME/Library/Application Support/Microsoft/Office/User Templates"


can anyone help me in this case?
Thank you

best regards,
Sanjeev



1 Comment   [ + ] Show comment
  • I do not know much about MACs but couldn't you set the KACE script to run as the Logged On User? They should have the rights to their own folders. - JordanNolan 10 years ago

Answers (1)

Posted by: bknorr 10 years ago
Purple Belt
2
In my experience, running anything from K1000 should be done as root since you are doing administrative tasks that are modifying the system in question. I've been sort of fumbling through these scripts for a few years, so I have made them work just well enough for my needs. 

Here is a snippet of something I use to change something for every user on a system (useful when installing an app that needs certain files to exist in each user's local directory):

#!/bin/bash
##
## Copy something to each user's profile
##
cd /Users
for i in $(ls -d *)
do
    if [ "$i" == "Shared" ]
    then
        echo "We don't need to modify our shared directory."
    else
        cp -a $(KACE_DEPENDENCY_DIR)/Template.docm /Users/$i/Library/Application\ Support/Microsoft/Office/User\ Templates/
        chown $i /Users/$i/Library/Application\ Support/Microsoft/Office/User\ Templates/Template.docm
    fi
done

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ