Run PowerShell script on a schedule
It's great to see the Intune Management Extensions available now, but what would be even better is to extend this functionality to be able to run powershell scripts on a schedule or in a repeated fashion.
The setting could be put under Device Configuration -> PowerShell Scripts -> [script name] -> Settings -> [script settings].
It would be fantastic to be able to have a script execute from intune like it were a scheduled task. eg. Mon, Tue, Wed, Thurs, Fri, Sat, Sun, and a time. Or have options for "Every 1 week" or "Custom" where we can put the number of days.
Anyway it's just an idea which I think would add real value to this fantastic new capability.
Yes there is a dirty trick - just delete the corresponding registry keys with an intune Win32app (just a powershell script again). This will run on a schedule and depending on the detection its running again (false if registry key exists) After that the agent will see there were never scripts executed and it will run the scripts deployed in intune > device > powershell again
Duncan de Waal commented
Such a simple but brilliant idea.
It is just a bit embarrassing that this isn't possible yet, or is there maybe another way to achieve the same already?
Nicole Qu commented
Could you use Proactive Remediations for this?
Rob Orrock commented
+1 for this
Jonathan G commented
+1 Definitely would love this feature
Would be great.. After 3 years still not implemented is a shame.
Check out the new Proactive remediations (in preview): https://docs.microsoft.com/en-us/mem/analytics/proactive-remediations
You can create detection script and remediation script and create assignment with schedule.
How is this still not a thing?
André Eriksson commented
The functionality of task scheduling to also execute the scripts on device start, login and logout would really move a lot of our clients to modern management.
Checkout this new Modern MDM tool we are using, they allow you to run anything on a schedular, specially scripts. I find it extremely useful, Also they allow you to do pull not just push, so if you run a powershell command, you will get your result from the endpoints, user or etc in the portal based on whatever data you have requested. This is so cool
Jake Ives commented
I like the idea of this feature.
Would be really handy
Daniel Ratliff commented
This is a must have in order to be able to deliver the same capabilities as traditional management tools like Group Policy and SCCM Baselines. We need settings to not just be set once, but enforced, to prevent configuration drift.
The powershell support in Intune so rudimentary. This would be a very valuable addition.
We miss it every day to run powershell on each logon
Jason Beer commented
We need some sort of option that allows scripts to be run more than once. After reboot, each login, etc.
Michael Mardahl commented
I have made a solution for this! Also put a pre-made MSI for this in GitHub, ready to deploy. https://www.iphase.dk/force-reload-intune-powershell-scripts/
Let me know if it needs any adjustments, via Twitter or GitHub issues.
We need to make the script run after each login
And put a powershell detection script like Win32 apps in Intune, and the script could trigger based on the detection when needed.