<# Author: Andy Horne, Wavenet Reference Source: https://learn.microsoft.com/en-us/answers/questions/262724/configure-gpo-to-trun-off-metered-network-connecti Synopsis: Turn off metered LAN connection which causes issues with SCCM communications and actions. Dependancy on LAN connection being named 'Ethernet' Restart of PC not required (dependant service 'DusmSvc - Data Usage' restarted) Version Control v1.0 06/12/2024 - Andy Horne, script creation / adaption from online source #> $bChanged = $false $oEthernetNICs = (Get-NetAdapter | Where{$_.InterfaceDescription -like "Ethernet*"}) foreach ($oNIC in $oEthernetNICs) { if ($oNIC.Status -eq "Up") { $sGUID = $oNIC.InterfaceGuid $sRegPath = "HKLM:\SOFTWARE\Microsoft\DusmSvc\Profiles\$sGUID\*" if (Test-Path -Path $sRegPath ) { $iCost = (Get-ItemProperty -Path $sRegPath -Name UserCost).UserCost if ($iCost -ne 0) { # turn off metered connection (2=turn on) Set-ItemProperty -Path $sRegPath -Name UserCost -Value 0 | Out-Null $bChanged = $true } } } } if ($bChanged -eq $true) { Restart-Service -Name DusmSvc -Force Write-Host "Metered LAN connection turned off." } else { Write-Host "No metered LAN connections found." }