Script Update: Automatically remind users to update iOS with e-mails and custom notifications using Microsoft Intune Powershell SDK


If you already use or intend to use my script, which reminds users to update iOS with e-mails and custom notification, you will want to use the updated script. 🙂

I obviously put the script to use in production, and quickly realized that the script also picks up obsolete devices. This is not ideal, as you might end up in a situation where a user is reminded by e-mail, to update a device which is obsolete and no longer in use.

So the script has been updated to cater for this situation, and now only picks up devices which has been syncing with Microsoft Intune within the last 2 days.


  • Now counting days since last synchronization with Microsoft Intune
    • This is hard coded to only grab iOS devices which has checked in with Intune the last 2 days. Change this to suit your needs

  • Added $testMode for quickly turning test mode on and off
    • I personally needed this to test the script more sufficiently without having to modify the script too much
    • When set to $true, the script only grabs devices belonging to a specific UPN ($testUPN) and overrides the baseline version

Changes in Action

A quick snip of the updated script in action running with Azure Automation. Stuff is obfuscated as this is run in production 🙂


I’m still making my way to GitHub, so the script is still available for download on TechNet Gallery:


2 thoughts on “Script Update: Automatically remind users to update iOS with e-mails and custom notifications using Microsoft Intune Powershell SDK”

  1. Hello Martin,

    I am trying to get the script running on our tenant but when executing a test we are getting an error:

    Getting all iOS devices belonging to the baseline UPN: ***upn removed***
    System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
    at CallSite.Target(Closure , CallSite , Object )
    at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
    at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    Testing! testMode equals True. Overriding baseline version and iOS devices found for testing purposes

    Please advice

  2. Hello,

    Looks like the script is not working with more than 1000 IntuneManaged Devices because MSGraph has a limit of 1000 devices to show in the list.

    Can you confirm this and could you tell me how to get rid of this limit?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.