Intune does not have a native solution for logon scripts. The community has designed some interesting solutions to this problem using the Intune Management Extension, such as Nicola’s Azure storage based method, Michael Mardahl’s IME reset method and my own hidden vbscript scheduled task method.
The problem with all these solutions is that they rely on scheduled tasks. This is not the most reliable method as the user can easily influence it, and it usually does not support uninstalling or unassigning the script unless you write a specific script for that, assign it to the user, etc yada yada.
So i wrote a script template that can run at logon, at set intervals or both and supports ANY script you write in Intune. invoke-asIntuneLogonScript on Git
Insert your code, upload to Intune as usual, and set the properties as follows and assign to your users: