We have a PowerShell script that I need to run during provisioning after the device has joined the domain.
I have copied this script to a folder on the local device and then used execute file in the provisioning tasks to run the script.
My question is under what context does that script now run?
Is it local system?
The script runs but hangs and when I run this locally it has access denied. I have found that I need to run PowerShell elevated for the script to run. Is there a way to do this during the provisioning task?
Or do I need to do some PS jiggery pockery to get it to run elevated?
Any thoughts welcome.