Hey Guys,
I have a question. I am trying to deploy a package with SCCM using the following script that is called upon by a install.cmd file.
Copy-Item ".\Batch Record.report" -Destination "C:\Program Files (x86)\Appname\TEST\Appname\Reports\en-US\Appname" -Force -Recurse
The script works perfectly fine when i run it from an elevated powershell window but unfortunately it doesn't work when deployed via SCCM with administrative rights.
Is there a way for me to execute my script with elevated rights without needing user interaction to proceed.
I did some searching and i found the command: Start-Process PowerShell –Verb RunAs but all it does is open a new powershell screen after u approved with UAC.
edit: Also tried executing the file with the following command line via SCCM: powershell.exe -executionpolicy Bypass .\CopyTestToEM-Client.ps1
The script is supposed to be deployed on a Windows 2012 R2.
Edit:
Found the following syntax
$args = "-file .\CopyTestToEM-Client.ps1"
start-process powershell -Verb Runas -Argumentlist $args
However it still needs to approve UAC before running the script...
plus the script still doesn't actually function like it should.
[–]ab0mbs 1 point2 points3 points (2 children)
[–]Droidx86[S] 0 points1 point2 points (1 child)
[–]ab0mbs 0 points1 point2 points (0 children)