Windows 10: Script for ICS bug in windows 10

Discus and support Script for ICS bug in windows 10 in Windows 10 Network and Sharing to solve the problem; Bonjour, j'ai crée un petit script qui peux vous aider à réglé le soucis de Internet Connection Sharing. Il faut le mettre en tache planifier au... Discussion in 'Windows 10 Network and Sharing' started by AlexandreRenoux1, Jul 18, 2018.

  1. Script for ICS bug in windows 10


    Bonjour,


    j'ai crée un petit script qui peux vous aider à réglé le soucis de Internet Connection Sharing. Il faut le mettre en tache planifier au démarrage,

    il vous faudra modifier le nom de l'interface à match, ici je partage une connexion VPN.



    #Get des info sur la carte reseau physique et viruel (VPN)
    $MainAdapter = Get-NetAdapter | Where-Object {$_.InterfaceDescription -match 'Realtek'}
    $VpnAdapter = Get-NetAdapter | Where-Object {$_.InterfaceDescription -match 'TAP'}

    #Récuperation des elements utile pour la suite
    $id_carte_physique = $MainAdapter.ifIndex
    $alias_carte_physique = $MainAdapter.InterfaceAlias
    $alias_carte_virtuel = $VpnAdapter.InterfaceAlias

    #Recuperation de l'adresse IP/GW de la carte physique
    $ip_physique = (Get-NetIPAddress -InterfaceIndex $id_carte_physique).IPAddress
    $GW_physique = (Get-NetIPConfiguration -InterfaceIndex $id_carte_physique).IPv4DefaultGateway.NextHop

    #Inscription de la dll pour l'objet HNetCfg.HNetShare
    regsvr32 hnetcfg.dll /s

    #Reset ICS
    $m = New-Object -ComObject HNetCfg.HNetShare
    if ($m.EnumEveryConnection -ne $null) {

    $pubConn = $m.EnumEveryConnection | where {$m.NetConnectionProps.Invoke($_).Name -eq $alias_carte_physique}
    $privConn = $m.EnumEveryConnection | where {$m.NetConnectionProps.Invoke($_).Name -eq $alias_carte_virtuel}

    $pubConnConf = $m.INetSharingConfigurationForINetConnection.Invoke($pubConn)
    $privConnConf = $m.INetSharingConfigurationForINetConnection.Invoke($privConn)

    $pubConnConf.DisableSharing()
    $privConnConf.DisableSharing()

    $pubConnConf.EnableSharing(1)
    $privConnConf.EnableSharing(0)
    }

    #Suppresion de l'adresse ICS par défaut
    Remove-NetIPAddress –InterfaceIndex $id_carte_physique –IPAddress 192.168.137.1 –PrefixLength 24 -confirm:$false

    #Assignation IP/GW/DNS Physique
    New-NetIPAddress –InterfaceIndex $id_carte_physique –IPAddress $ip_physique –PrefixLength 24 –DefaultGateway 172.20.19.1
    Set-DnsClientServerAddress –InterfaceIndex $id_carte_physique -ServerAddresses $GW_physique -confirm:$false


    #Suppression des doublons des regles de firewall
    $all_firewall_rules = Get-NetFirewallRule

    $Array_rules = @()

    foreach ($firewall_rule in $all_firewall_rules)
    {
    $unique = $true
    foreach($rule in $Array_rules)
    {

    if($firewall_rule.DisplayName -eq $rule.DisplayName)
    {
    if($firewall_rule.Profiles -eq $rule.Profiles)
    {
    $unique = $false

    }
    }
    CS
    }
    if($unique)
    {
    $temp_rules = New-Object System.Object
    $temp_rules | Add-Member -type NoteProperty -name DisplayName -value $firewall_rule.DisplayName
    $temp_rules | Add-Member -type NoteProperty -name Profiles -value $firewall_rule.Profiles
    $Array_rules += $temp_rules
    }
    else
    {
    Remove-NetFirewallRule -name $firewall_rule.Name
    write-host "Suppresion " $firewall_rule.displayName

    }
    }


    Il désactive et reactive un partage réseaux, assigne l'IP et supprime les doublons du firewall.


    Bye Script for ICS bug in windows 10 :)

    :)
     
    AlexandreRenoux1, Jul 18, 2018
    #1
  2. Ahhzz Win User

    Windows 10 Tweaks

    Pressing “Windows+Pause Break” (it’s up there next to scroll lock) opens the “System” Window.

    Windows 10: In the new version of Windows, Explorer has a section called Quick Access. This includes your frequent folders and recent files. Explorer defaults to opening this page when you open a new window. If you’d rather open the usual This PC, with links to your drives and library folders, follow these steps:

    • Open a new Explorer window.
    • Click View in the ribbon.
    • Click Options.
    • Under General, next to “Open File Explorer to:” choose “This PC.”
    • Click OK


    credit to Lifehacker.
     
    Ahhzz, Jul 18, 2018
    #2
  3. How to list the ICS clients' IP addresses in Windows 10?


    Hello,
    I'm using ICS on Windows 10 (has both WiFi and Ethernet) to share Internet with other Windows 10 machines (on Ethernet) and is working perfectly fine. The Server is getting assigned 192.168.137.1 IP and the clients are getting IP's in the same subnet but with random IP addresses. I would like to know from the ICS server about the list IPs assigned to the ICS clients so that I can communicate with clients with IP. I don't have monitors connected to the clients, I access them vi RDP.

    Please advise if it is possible to know the clients' assigned IPs (ofcourse, i can run a script with ping to each IP in the sequence to find out which IPs are UP but I don't want to do that way) from ICS server. If NOT then is there any easy free alternative to ICS?

    Thanks
     
    rallabandi, Jul 18, 2018
    #3
  4. Script for ICS bug in windows 10

    Windows Script Host

    Hi Tiara,

    The message "Windows Script Host access is disabled on this machine. Contact your administrator for details" is usually occurring if a program that does not require the feature of Windows Script Host is running on a Windows PC. For us to provide an accurate
    solution, we would need you to answer the following questions:

    • Which build, version and edition of Windows is installed on your computer?
    • Does the message appear when you are launching a specific application?
    • What changes were made to the device before this issue happened?

    For initial troubleshooting, we suggest following the steps provided by
    Ramesh Srinivasan
    in this thread.

    We are looking forward to your response.
     
    Darleen Pen, Jul 18, 2018
    #4
Thema:

Script for ICS bug in windows 10

Loading...
  1. Script for ICS bug in windows 10 - Similar Threads - Script ICS bug

  2. Windows ics service not working properly.

    in Windows 10 Software and Apps
    Windows ics service not working properly.: I am using my laptop to connect to wifi and then using the single ethernet port to share internet to my Xbox 360 but as soon as I turn on ICS my wifi stays connected to my wifi but suddenly says no internet connection, I have unistalled my antivirus as the laptop does not...
  3. Windows ics service not working properly.

    in Windows 10 Gaming
    Windows ics service not working properly.: I am using my laptop to connect to wifi and then using the single ethernet port to share internet to my Xbox 360 but as soon as I turn on ICS my wifi stays connected to my wifi but suddenly says no internet connection, I have unistalled my antivirus as the laptop does not...
  4. Windows ics service not working properly.

    in Windows 10 Network and Sharing
    Windows ics service not working properly.: I am using my laptop to connect to wifi and then using the single ethernet port to share internet to my Xbox 360 but as soon as I turn on ICS my wifi stays connected to my wifi but suddenly says no internet connection, I have unistalled my antivirus as the laptop does not...
  5. Windows 10 ICS Internet connection sharing is not working correctly.

    in Windows 10 Gaming
    Windows 10 ICS Internet connection sharing is not working correctly.: For context, I am trying to use one long ethernet cable to give two computers internet. WI-FI is not strong enough where the computers are located to use that as a solution . One of the computers has two gigabit LAN connections, and is the one that I am trying to enable ICS...
  6. ICS Sharing on Win-10

    in Windows 10 Drivers and Hardware
    ICS Sharing on Win-10: on Windows 10 i am currently sharring my main internet to other ics but everytime i restart the pc shared ics loose the internet have to do re share it any solution for this?...
  7. Internet Connection Sharing ICS is slow Windows 10

    in Windows 10 Network and Sharing
    Internet Connection Sharing ICS is slow Windows 10: Hello, I have a problem with slow internet using Internet Connection Sharing on Windows 10. The scenario: PC A has no wifi antenna but needs internet. PC B has a wifi antenna and is connected to the internet via wifi. With an ethernet cable A is connected to B. B is using...
  8. ICS dropdown box missing

    in Windows 10 Network and Sharing
    ICS dropdown box missing: I have the same issue as this guy here. The issue is still unsolved, the dropdown box is still missing. On my PC it is working but on my Surface it isn't. https://answers.microsoft.com/en-us/windows/forum/all/ics-dropdown-box-missing/5c85e2c0-e049-4b38-b294-239fe486932a
  9. Location of Windows Calendar .ics files?

    in Windows 10 Software and Apps
    Location of Windows Calendar .ics files?: Anyone know the location of the .ics files saved by Windows Calendar? I am hoping to use these files for the Rainlendar program.. 20127
  10. Windows 10 ICS Issues.

    in Windows 10 Network and Sharing
    Windows 10 ICS Issues.: Hey all, I am currently using a USB Data Modem on my laptop. I'm trying to share my USB Modem's connection with my router using an Ethernet cord and the windows 10 ICS tool. This worked flawlessly on windows 7, but for some reason is not working on windows 10. My Set...