Nov 16 2023 08:11 AM
Maybe I'm just missing something here, but when a Remediation script repeats on a schedule, how can we tell if devices were remediated? All devices report "Without Issues" and ZERO devices fixed, but I know the script ran and fixed the problem weeks ago. Say I have 100 devices assigned to the script:
- If the script runs just one time, everything reports fine. The Remediation Status shows "Issue Fixed" for all 100 devices.
- If the script repeats (say daily), the 2nd run clears out these statuses. All 100 devices now show Remediation Status of "Not Run". Remediation status overview show 0 devices.
Is this by design? This just doesn't make logical sense to me. If a device got remediated, in my mind it should always show that status as "fixed" so that my admins know it had the problem at some point, and the script fixed it.
Nov 16 2023 01:48 PM
Hello @Eric_H
Welcome to the Microsoft community, my name is Recep I'll be happy to help you today.
Advice:
# Your remediation script logic here
# Example: Fixing an issue (replace this with your actual remediation logic) # For demonstration purposes, let's assume you're fixing a registry key issue. $RegistryPath = "HKLM:\SOFTWARE\YourApplication" $RegistryProperty = "SomeSetting" $DesiredValue = "CorrectValue"
# Check if the registry key exists and has the correct value if (Test-Path $RegistryPath -and (Get-ItemProperty -Path $RegistryPath).$RegistryProperty -eq $DesiredValue) { Write-Host "Registry key is already remediated. No action needed." } else { # Fix the issue (replace this with your actual remediation logic) New-Item -Path $RegistryPath -Force Set-ItemProperty -Path $RegistryPath -Name $RegistryProperty -Value $DesiredValue
Write-Host "Issue remediated successfully." } |
If I have answered your question, please mark your post as Solved If you like my response, please give it a Like Appreciate your Kudos! Proud to contribute! 🙂 |
Nov 16 2023 11:27 PM
Dec 04 2023 02:57 PM
Dec 04 2023 03:03 PM
Shout out to karbonx1 for the scripts detecting LLMNR and Netbios.
https://www.reddit.com/r/Intune/comments/nqpi60/proactive_remediation_scripts_to_disable_llmnr/
Like I mentioned, they run fine and report to the Intune portal correctly on the first execution of the schedule. But on the second execution (day 2) Intune resets all the stats. In a way I suppose it is reporting correctly - on day 2 the detection script runs and finds no devices with the problem, so no devices are "remediated." However, just logically, I would think the portal would keep a count of devices that have been remediated over time. Appreciate you glancing at the script as I am new to this - maybe I'm doing something wrong.
Dec 04 2023 09:59 PM