u/Massive_Age8849

Is modifying the Windows hosts file via Intune Remediation Powershell script still supported? Cause I get an Access Denied Error.
▲ 14 r/Intune

Is modifying the Windows hosts file via Intune Remediation Powershell script still supported? Cause I get an Access Denied Error.

Hi everyone,

I'm trying to deploy a simple modification to the Windows hosts file using Microsoft Intune with a Remediations Powershell script but the modification is always denied on my devices.

I've seen this method on various websites and here one reddit, and I've tried it with Add-Content and Set-Content, but it doesn't work.

Source :
https://www.nielskok.tech/intune/set-hosts-file-via-intune/
https://cloudinfra.net/update-add-append-entries-in-hosts-file-using-intune/

Before I spend more time troubleshooting my environment, I'd like to know:

Has anyone successfully modified the Windows hosts file through Intune recently?
If yes, did you use a Remediation script as described in the sources?

I'm mainly trying to determine whether this is still a supported/reliable approach or if the issue is specific to my environment.

Thanks!

u/Massive_Age8849 — 3 days ago