Windows 10: Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...

Discus and support Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... in Windows 10 Network and Sharing to solve the problem; My Wifi connection randomly disconnects from the internet. Using PowerShell Get-NetConnectionProfile, I found that the IPv4Connectivity attribute on... Discussion in 'Windows 10 Network and Sharing' started by ZQ_995, Jul 5, 2022.

  1. ZQ_995 Win User

    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...


    My Wifi connection randomly disconnects from the internet. Using PowerShell Get-NetConnectionProfile, I found that the IPv4Connectivity attribute on the network profile changes from Internet to LocalNetwork when my internet disconnection happens.Name : Asus-5Ghz-2InterfaceAlias : Broken Wifi InterfaceIndex : 20 NetworkCategory : Private IPv4Connectivity : Internet --> LocalNetworkIPv6Connectivity : NoTrafficHence, I tried to use PowerShell Set-NetConnectionProfile to set IPv4Connectivity attribute back to Internet from LocalNetwork. The command I used is as per the exampl

    :)
     
    ZQ_995, Jul 5, 2022
    #1
  2. sml156 Win User

    Set Network Location to Private or Public in Windows 10


    Hi Brink great job I have one more way of changing the network location so if you ever get the time to add an option 4 here it is, Feel free to delete this post if you do.

    Option 4 To Change Network Location in Settings in Powershell

    open Powershell as an administrator


    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... [​IMG]


    Enter this command
    Code:
    Code:
    Get-NetConnectionProfile
    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... [​IMG]


    Find the interface you would like to change, In my case it is Ethernet-2.
    Note: Originally my interface was called " Ethernet 2 " Powershell would not accept the following commands with a space so I renamed the interface to " Ethernet-2 " .

    To change the interface type or copy paste the following command

    Code:
    Code:
    Set-NetConnectionProfile -InterfaceAlias Ethernet-2 -NetworkCategory Private
    Or to set it to Public

    Code:
    Code:
    Set-NetConnectionProfile -InterfaceAlias Ethernet-2 -NetworkCategory Public
    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... [​IMG]


    Note you can also change the interface by using other names
    Code:
    Code:
    Name             : XXXXX InterfaceAlias   : Wi-Fi InterfaceIndex   : 8 NetworkCategory  : Public IPv4Connectivity : Internet IPv6Connectivity : NoTraffic Name             : Unidentified InterfaceAlias   : Ethernet 2 InterfaceIndex   : 14 NetworkCategory  : Public IPv4Connectivity : NoTraffic IPv6Connectivity : NoTraffic  Set-NetConnectionProfile -InterfaceIndex 14 -NetworkCategory Private Set-NetConnectionProfile -IPv4Connectivity NoTraffic -NetworkCategory Private  and so on.
    No matter what I do the changes are not persistent after a reboot no matter what method I have tried in your tutorial I think it has something to do with " Network location Awareness " I think I will have to make a automated task in task scheduler to make it persistant.

    Before and after picks of Network and sharing center

    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... [​IMG]



    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... [​IMG]
     
    sml156, Jul 5, 2022
    #2
  3. How to set the network profile for Public, Home, etc. in Windows 10??

    To change it now, you either have to delete the network profile and let it recreate - make sure you choose the right setting! Or you can use PowerShell:

    Open Start

    Type: powershell

    Right click powershell

    Click Run as administrator

    Type the following at the command prompt then hit Enter:

    Get-NetConnectionProfile

    This command will list the profiles and from which you need to find the index number

    Set-NetConnectionProfile -InterfaceIndex 1 -NetworkCategory Private

    Where 1 is the index number of the profile to change so it might be a different number other than 1 on your system.
     
    Andre Da Costa, Jul 5, 2022
    #3
  4. AMorris76 Win User

    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...

    Cannot change network profile from Public to Private

    I have searched and seen numerous posts about the latest builds of Windows 10 removing the easy way to change your network profile from Public to Private, and vice versa. I have tried both the Powershell (Admin) method and the registry change method. With
    both, the changes do not stick. Below is what I get when I run Powershell:

    PS C:\WINDOWS\system32> get-NetConnectionProfile

    Name : xxxxx 3
    InterfaceAlias : Wi-Fi 2
    InterfaceIndex : 20
    NetworkCategory : Public
    IPv4Connectivity : Internet
    IPv6Connectivity : NoTraffic

    PS C:\WINDOWS\system32> set-NetConnectionProfile -InterfaceIndex 20 -NetworkCategory Private
    PS C:\WINDOWS\system32> get-NetConnectionProfile

    Name : xxxxx 3
    InterfaceAlias : Wi-Fi 2
    InterfaceIndex : 20
    NetworkCategory : Public
    IPv4Connectivity : Internet
    IPv6Connectivity : NoTraffic

    PS C:\WINDOWS\system32>

    I am on Windows 10 Home, Build 17134. I would appreciate any help the community can give to resolve this issue, hopefully without a full wipe and re-installation.
     
    AMorris76, Jul 5, 2022
    #4
Thema:

Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...

Loading...
  1. Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but... - Similar Threads - Powershell Set NetConnectionProfile

  2. Can't set a profile picture in settings..

    in Windows Hello & Lockscreen
    Can't set a profile picture in settings..: I tried with a local & microsoft account..Still not working.. I even tried to click "Camera" and "Browse for one" and I even changed it from web and it's not working..Output:Account picture errorThis picture couldn't be saved.Additional problem information: Error Code:...
  3. Can't set a profile picture in settings..

    in Windows 10 Gaming
    Can't set a profile picture in settings..: I tried with a local & microsoft account..Still not working.. I even tried to click "Camera" and "Browse for one" and I even changed it from web and it's not working..Output:Account picture errorThis picture couldn't be saved.Additional problem information: Error Code:...
  4. Can't set a profile picture in settings..

    in Windows 10 Software and Apps
    Can't set a profile picture in settings..: I tried with a local & microsoft account..Still not working.. I even tried to click "Camera" and "Browse for one" and I even changed it from web and it's not working..Output:Account picture errorThis picture couldn't be saved.Additional problem information: Error Code:...
  5. Can't set a profile picture in settings..

    in Windows 10 Customization
    Can't set a profile picture in settings..: I tried with a local & microsoft account..Still not working.. I even tried to click "Camera" and "Browse for one" and I even changed it from web and it's not working..Output:Account picture errorThis picture couldn't be saved.Additional problem information: Error Code:...
  6. Setting innerHTML crashes PowerShell?

    in Windows 10 Gaming
    Setting innerHTML crashes PowerShell?: I have a PowerShell script that has been running flawlessly every day for 4 years. It reads a portion of HTML, finds a specific element, and replaces the content of that element:function Build-HTML { '<h1>New for Today</h1>' '<p><br/></p>' '<h1>Index by Message</h1>'}$content...
  7. Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...

    in Windows 10 Software and Apps
    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...: My Wifi connection randomly disconnects from the internet. Using PowerShell Get-NetConnectionProfile, I found that the IPv4Connectivity attribute on the network profile changes from Internet to LocalNetwork when my internet disconnection happens.Name :...
  8. Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...

    in Windows 10 Gaming
    Powershell Set-NetConnectionProfile -IPv4Connectivity 'Internet' not setting profile but...: My Wifi connection randomly disconnects from the internet. Using PowerShell Get-NetConnectionProfile, I found that the IPv4Connectivity attribute on the network profile changes from Internet to LocalNetwork when my internet disconnection happens.Name :...
  9. Powershell: Set-BCDelement unuseable?

    in Windows 10 Gaming
    Powershell: Set-BCDelement unuseable?: PS C:\Users\Administrator> Set-BcdElement -id 6a20072e-86a8-11ec-87f7-87358376978b -Element filedevice -Device partition -Value \Device\HarddiskVolume11Set-BcdElement : The specified element filedevice is not valid for the specified entry...
  10. PowerShell profile

    in Windows 10 Network and Sharing
    PowerShell profile: Hi I had a PowerShell profile that worked fine with Windows 7 (PS v3): <code> #CSOM first [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")...