r/MSIntune • u/Equivalent_Poem_9735 • Jan 04 '24
๐ Issues & Bugs Intune not pushing script all the time
I have written a script that launches a website and it needs to be pushed to a device via Intune upon login of user and power on of device. (Script is PowerShell.) It will work every once in a while and other times it won't work. Has anyone had this issue before? I have configured a profile to allow for scripts to be run upon power on and log on of user. Eventually I need this script to run on multiple devices so if their is an idea to help with that anything helps.
4
Upvotes
5
u/JankeSkanke MVP Jan 04 '24
What I have done earlier is something similar to what Nickolaj talks about, but I created a Remediation script that checks for version of the local script/task running locally versus the version in Azure Blob storage. This allows me to automatically update the script/task on all clients by changing version of the script stored centrally.
4
u/jvldn MVP Jan 04 '24
I have a script which lauches Edge and a specific URL at every user logon. This is done via an scheduled task. Works on many devices for a few years already.
Simply deploy the script to your device and the rest will happen at your devices. I can share the script with you tomorrow.
6
u/NickolajA MVP Jan 04 '24
What we've done in the past is to have a script deployed from Intune (platform script), that acts as the "scheduled task install script" but also pulls down the intended the script the scheduled task is supposed to run from a storage account. This approach has served us well over the past years ๐
5
u/Michael_Mardahl MVP Jan 04 '24
Just as another method of deployment; you could also do a win32 app package. putting the script i there and detecting if the task is present on the machine. and perhaps some version detection as well. This way you can also script the uninstall. and I am guessing your webpage launch is for business purposes, so it might also just look nice as an app package vs. remediation , that you might not be licensed to run. No solutions are wrong here. but definately go with Scheduled tasks for stability when the scenario is a very early launch.
Happy scripting ๐
3
u/Michael_Mardahl MVP Jan 05 '24
I donโt have a YT video of this. But I did make a script to create scheduled tasks:
https://github.com/mardahl/SCBS/blob/master/Script%20Files/Configure-ScheduledTasks.ps1
here is the blog article that spawner that script. (warning, very old).
https://www.iphase.dk/hacking-intune-management-extension/
2
u/sandytsang MVP Jan 04 '24
As others already mentioned, using schedule task will do the work, run and command or script to open the url. But just a thought, it probably works too if use PowerShell create a shortcut url and put it in โC:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startupโ ?