I've been using a PowerShell script to update my hosts file, which includes creating a scheduled task and logging for periodic updates. However, I've encountered some problems when running it. The script has a backup URL it tries to access for a blocklist, but the logs indicate it's failing to connect to these URLs. Interestingly, I can access those URLs directly in my browser without any issues. I asked the author of the script for help, but they suggested the problem lies with my computer's environment. After trying many fixes, I found that changing the task's user from 'SYSTEM' to my own user account solved the issue, but I'm confused about why this difference matters—especially since it worked fine on my roommate's Windows 11 (24H2) system, while mine is on Windows 11 (25H2). Can anyone explain this or suggest other troubleshooting steps?
3 Answers
It might be a bug or compatibility issue with the specific version of Windows you're using. The two machines might have different settings or configurations leading to this discrepancy. A clean reboot or adjusting network settings further might help, but it seems like you've already done a lot of troubleshooting! Just keep an eye on the logs for any other errors that crop up.
It's definitely peculiar that the task works under one user but not another. There may be permissions issues at play. Have you checked if both user accounts have the same permissions? It's possible the script is trying to access something under SYSTEM that it doesn't have clearance for when run as your user.
Exactly! I've faced similar issues where user permissions prevented scripts from accessing essential files. Always worth double-checking those settings.
Honestly, it raises some red flags. Running scripts with admin rights, especially ones that manipulate the hosts file, can be risky. It's crucial to trust the application you're using because it could have serious security implications. Just thinking about it, if the script executes unwanted modifications, it can redirect your internet traffic without you knowing, which is why the environment might impact its execution. You did the right thing by switching the user to avoid potential security risks! I would also recommend scanning your system for malware, just in case.
That's a good point! It's always better to play it safe. I recently had a similar issue with a script that turned out to be making hidden changes. Always trust, but verify.

Right? And sometimes, minor updates in those versions can break certain functionalities. It's always good to stay updated and also check forums for any known issues after a Windows update.