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:
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.
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
Answers (1)
Please log in to answer
Posted by:
chucksteel
6 years ago
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.
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 6 years ago
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 6 years ago