We are facing an issue with proactive remediation scripts if we are running as logon user and not admin. We want to check hourly if onedrive is running and if its not to start it.
As we run the following as shown on the screenshot, we get the error that onedrive cannot run using administrator
$OneDriveProc = "C:\Program Files\Microsoft OneDrive\OneDrive.exe"
Start-Process -FilePath $OneDriveProc -ArgumentList "/background"
Proactive remediation scripts that need to run as administrator are working as intended, can anyone replicate and let us know the results?