Hi all, i have a question regarding Start-ADTProcessAsUser.
For reference. I have a Script share only accessible to specific users / PC Accounts on my AD. In there my PSADT folder is located.
I also have a Scheduled task that runs the Invoke-AppDeployToolkit.ps1 as SYSTEM. (need it to rename the PC Account)
I also have a section that sets Windows Language/Culture/Region etc.. but it sometimes needs to run under the User context too. (Troubleshooting or re-applying the defaults)
For this is use Start-ADTProcessAsUser -FilePath "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -ArgumentList "-NoProfile -NonInteractive -ExecutionPolicy Bypass -File"$scriptPath""
-CreateNoWindow -WaitForChildProcesses -PassThru
The script is under a Path that can be accessed by the user of course.
If the script runs as system with the user logged in -> all good.
If i run it as Admin with the user logged in (throught the .exe or ps1) i get an error on the ProcessAsUser side.
What could cause this? how could i possibly fix this?
Thanks and BR