everyone. I’ve inserted a powershell script to run when user clicks on utilman (Ease of access) button to perform some default troubleshootings. But i’ve experiencing some errors cause my scripts are not running as full elevated users.
For example, i’ve created a script that delete all user’s profile from windows (win32_userprofile), but it returns “COMException – Result Code 0x80070522” when i run it with blocked screen, even when i pass admin credentials with Get-Credential method, it returns that error. But when i run that script with unlocked screen, it works great!
Is there a way that i can run scripts with full admin rights while screen is blocked? Do anyone have any idea to help me? I’m desperate 🙁
PS: I’ve tried to run with external software that gives admin rights too (elevate.exe) and didn’t work.