Hello to all
I have been asked to create a script to copy and replace files and folders from a UNC path to any path on a local machine.
The powers that be want it to deploy via SCCM 2012 so we can monitor deployment etc. The script contains all the error checking and environment variables that it needs and it works perfectly, that is except for copying files to $env:Program Files or $env:Program Files (x86) for which it comes up with access is denied.
I have tested the script by elevating powershell to administrator locally on one of the machines and run the script and the files copy exactly how I would like it to.
The bottom line is this. (if at all possible)
I need to be able to elevate a script to administrator mode without user interaction to press yes on UAC.
If you can solve this or at least point me in the direction of an answer that isn’t hidden in a forum minefield then it would be gratefully appreciated by an awful lot of people in my organisation!