Windows – Internet Connection Sharing stopped working after Windows 10 Anniversary Update

windows 10windows-10-v1607

Since updating to Windows 10 1607 (the "Anniversary Update") my shared WiFi adapter isn't shared any more.

I share the WiFi connection with a Hyper-V switch so that my VMs have Internet access via the Surface Pro 2's WiFi connection. But since the update, this only works after manually disabling and re-enabling Internet Connection Sharing. Otherwise the internet sharing doesn't work even though the option is set in WiFi properties.

An ideas?

Internet Connection Sharing

Best Answer

This is a script that I use now and it works:


if (!$sPrivateAdapterName) {
    Write-Host "EnableSharing.ps1 sPublicAdapterName sPrivateAdapterName"

# Constants
$public = 0
$private = 1

Write-Host "Creating netshare object..."
$netshare = New-Object -ComObject HNetCfg.HNetShare

Write-Host "Getting public adapter..."
$publicadapter = $netshare.EnumEveryConnection | Where-Object {
    $netshare.NetConnectionProps($_).Name -eq $sPublicAdapterName

Write-Host "Getting private adapter..."
$privateadapter = $netshare.EnumEveryConnection | Where-Object {
    $netshare.NetConnectionProps($_).Name -eq $sPrivateAdapterName

Write-Host "Disabling and enabling public sharing for public adapter...."

Write-Host "Disabling and enabling private sharing for private adapter...."

# Clean up
Remove-Variable netshare
Related Question