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:

param(
    $sPublicAdapterName,
    $sPrivateAdapterName
)

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

# 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
}#foreach

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

Write-Host "Disabling and enabling public sharing for public adapter...."
$netshare.INetSharingConfigurationForINetConnection($publicadapter).DisableSharing()
$netshare.INetSharingConfigurationForINetConnection($publicadapter).EnableSharing($public)
$netshare.INetSharingConfigurationForINetConnection($publicadapter)

Write-Host "Disabling and enabling private sharing for private adapter...."
$netshare.INetSharingConfigurationForINetConnection($privateadapter).DisableSharing()
$netshare.INetSharingConfigurationForINetConnection($privateadapter).EnableSharing($private)
$netshare.INetSharingConfigurationForINetConnection($privateadapter)

# Clean up
Remove-Variable netshare
Related Question