So I am trying to figure out powershell script that will use Remove-LocalUser to clear local profiles off a remote computer using PDQ Deploy to push the power script. The tricky thing is that I have a GPO that does not allow remote scripts to run unless your the admin or run a powershell script that changes the settings in the registry to allow the script to run.
Back to my script I want to convert the last logged in user time to a readable value, then use a greater statement of 100 days so filter out old user accounts. Then I want to exclude the special accounts and PDQ admin account so I do not delete the local accounts. I have tried a few different ways to remove the delprof2 and a few powershell scripts that microsoft has but nothing fits my needs. Can someone point me in the correct direction.
OS - Windows 10 1703