/build/static/layout/Breadcrumb_cap_w.png

Post-installation task to run as administrator?

I've searched around ITninja and the Quest KB after exhausting all my knowledge, and have even tried looking into other options I could think of, hoping maybe someone here can give me some ideas.  Is there a way to allow a K2000 post install task to run with elevated privileges? I have a zipped up task to install a program and copy over a file after that is done, but it cannot copy that settings file to the folder.  I can finish the imaging process and log in on the system using the same local admin account used during the imaging process, download the zip file from the K2000, extract it and open a command prompt with elevated "run as administrator" rights and run the same batch file and it copies the settings file without issue.  Is there a way to make it run this command or any command with elevated privileges?
I am trying to copy an xml file for Cisco AnyConnect VPN to it's profile folder under C:\ProgramData
We are imaging Win10.

The batch file is super simple just:
msiexec /quiet /norestart /i anyconnect-win-4.6.01098-core-vpn-predeploy-k9.msi
copy /Y profile.xml "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile"
The app installs fine, just the profile.xml does not get copied over.

I have tried using the runas: command but it requires manual password input, kinda defeating the hands off imaging process.

Any help or pointing me to in a direction would be appreciated. 

2 Comments   [ + ] Show comments
  • I don't think it's a permissions issue, check chucksteel answer,

    the SDA will always run with the admin that was configured in the answer file, and UAC is off when running post install tasks - Channeler 5 years ago
  • Well, I got it working now after trying to check out the task folder that chucksteel was suggesting. I think it was trying to run the copy command to move the file too soon before the folder was created by the installer....
    When breaking the task and opening a command prompt, I ran each of the lines in my batch one by one and it all worked. I put in a couple of wait commands and re-uploaded and tested it out and it works now.
    Thanks for suggesting to check things out while the workflow is running, lead to me checking some things I hadn't thought of and figuring it out! - largomason 5 years ago

Answers (1)

Posted by: chucksteel 5 years ago
Red Belt
0
The post-install tasks run as whatever user you have configured to autologin to the computer. It also disables UAC, so there shouldn't be any prompts getting in the way. I would recommend checking the folder structure of the application after it has been extracted onto the computer. While your workflow is running and installing post-install tasks open a command prompt or explorer window and browse to c:\KACE\applications\ and find the folder for your task (named for the task's ID). Make sure that the profile.xml file is in the top of the folder along with the MSI file.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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