First: I'm not that good at powershell, but some easy scripts are ok. Right now i'm facing a problem and i just can't find the solution.
Within Intune i try to implement a detection script that detects a value within the registry if its 1. Here's the script i did:
$value = Get-ItemPropertyValue -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\DefaultMediaCost' -Name "4G"
if ($value -eq 1)
write-host "Compliant:False - run remediation"
write-host "Comliant:False - run remediation"
If i start this script manually with powershell (admin), the script works just fine. But if i deploy the script trough intune proactive remediation, it always tells me that theres no specific registry path - but its there fore sure. I first thought i may be the conext in whicht powershell via intune runs - but what else than system or admin should it be...
I see it comming - the solution will be absolutly clear and easy once someone will give the answer :D