Proactive remediation script using the logged-on credentials not working as intended

New Contributor

Hello community,

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"

 

simoscon_0-1670960894607.png

Proactive remediation scripts that need to run as administrator are working as intended, can anyone replicate and let us know the results?

Thanks 

Simos

1 Reply
Maybe creating a schedule task made to run at user logon will make more sense. FYI, ODfB service is already designed to start automatically as far as I know.