none
Use netsh command tool on Windows 10 IoT Core RRS feed

  • General discussion

  • If you have a device with no UI, display, or input devices, or you can’t configure it through the Windows Device Portal. Connect to your device using PowerShell or SSH and you can use netsh command tool edit some device settings.

    1. Edit firewall settings:

    • Sample #1 “Enable a port”

    netsh advfirewall firewall  add rule name="open port 8081" dir=in action=allow protocol=TCP localport=8081
    netsh advfirewall firewall  add rule name="open port 8081" dir=out action=allow protocol=TCP localport=8081
    netsh advfirewall firewall  show rule name="open port 8081"

    • Sample #2 “Enable a program”

    netsh advfirewall firewall add rule name="My Application" dir=in action=allow program="C:\MyApp\MyApp.exe" enable=yes

    • Sample #3 “Enable specific services”

    netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

    • Sample #4 “Block specific port”

    netsh advfirewall firewall add rule name="Block12345" protocol=TCP dir=in localport=12345 action=block

    Ref: “How to use the "netsh advfirewall firewall" context instead of the "netsh firewall" context” “Netsh AdvFirewall Firewall Commands

    1. Manage wireless network:

    • Sample #1  “Connect using WiFi Profile”

    // View wireless network profiles saved on your PC

    netsh wlan show profiles

    // Export the profile to an XML file

    netsh wlan export profile name=<your profilename>

    // Copy the exported WiFi profile XML file from the Windows PC to your Windows 10 IoT Core device

    // Connect to your device using PowerShell or SSH

    // Add the new WiFi profile to your device

    netsh wlan add profile filename=<copied XML path>

    // Connect the Windows 10 IoT Core device to wireless network

    netsh wlan connect name=<profile name>

    // Verify that your device is connected to the wireless network and can reach the internet

    netsh wlan show interfaces
    ipconfig /all
    ping bing.com

    Ref: “Using WiFi on your Windows 10 IoT Core device

    Others commands:

    // show the signal strength of the wireless networks

    netsh wlan show networks mode=bssid | findstr /I /R "SSID | signal"

    // Set device as access point(AP) if it supports AP role

    netsh wlan set hostednetwork mode=allow ssid=RPi2WiFi key=12345678
    netsh wlan start hostednetwork

    // View your network security key

    netsh wlan show profile name="Profile_Name" key=clear

    // Set auto/manual connect mode

    netsh wlan set profileparameter name="Profile_Name" connectionmode=manual
    netsh wlan set profileparameter name="Profile_Name" connectionmode=auto

    // Delete saved profile

    netsh wlan delete profile name="Profile_Name"

    Ref: “Netsh Commands for Wired Local Area Network (LAN)”

    1. Configure Wired Ethernet

    • Sample #1 “Configure a static IP address”

    // Get interface name

    netsh interface show interface

    // Set static IP address

    netsh interface ip set address "Ethernet" static 192.168.0.101 255.255.255.0 192.168.0.1

    Ref: “Netsh Commands for Interface (IPv4 and IPv6)”


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Friday, October 19, 2018 8:28 AM
    Moderator