scripts
1 TopicDeploying PS Script as Application Doesn't Work
I've been trying desperately to get a powershell script to run on a target machine using MECM. First to note, I inherited a partially built MECM environment from my predecessor that wasn't documented well and wasn't fully tested. We're now trying to migrate off of our ancient software deployment software to use MECM and need to do so ASAP because that server is on its last life at the moment. We have an application on our old system that requires the movement of license files from a network share into a specific folder within the target machine after the application installs. I've tested the application install separately and it works just fine. However, the copy job to move the files from the network share to the local PC fails. I've confirmed that the PS script itself works as expected. I can run it locally on the target machine when logged in as myself or an administrator. I confirmed that the script works even through MECM when I install it in the user context. However, whenever I try to either run the script directly (Assets and Compliance > Device Collections > right click on collection > Run Scripts), or create a deployment type using the script installer, the job doesn't work. 1 of 2 things happens. When running as a script directly, it will complete and state that it was successful (which I still find odd and not sure why that happens), but the actual process doesn't complete the copy, and so the files aren't copied over to the target machine. When running it as an application deployment, the installation fails outright with exit code 1. I've tried everything I can think of to get the PS script to run as a user for the entire system, but nothing seems to work. I've been troubleshooting this for over a week so I'm probably forgetting some efforts I've done, but I think this sums it up. I'm sure I'm not the only one trying to use MECM in this fashion, so I'm sure there's solutions out there, but either my google machine is broken and I can't seem to get the results I'm looking for or I'm simply missing something super simple that nobody has ever had a problem with...I'm fine with either, but could use the insight!Solved294Views0likes10Comments