It’s not well-known, but it’s completely possible to create a Wi-Fi network profile in Windows 11 without needing to be in range or immediately connect. This feature allows IT admins and power users to add a Wi-Fi network profile without connecting to it. In turn, this makes it easier to prepare devices for onboarding and future use, remote deployment, or restricted network access.
Pre-configuring Wi-Fi profiles needs to be part of the workflow when setting up computers for offices and remote sites, and getting users ready in a secure environment during onboarding. This guide will show you how to add a Wi-Fi network profile using various command line tools.
Ways to add a wifi network without connecting to it in Windows 11
📌 Prerequisites:
- These methods apply to all Windows 11 editions (Home, Pro, Enterprise, Education).
- You need administrator privileges, especially when running netsh commands via the Command Prompt.
- You need to have the following information ready for the Wi-Fi network you want to add:
- SSID (network name)
- Security type
- Encryption type and password (if applicable)
📌 Recommended deployment strategies:
| Click to Choose a Method | 💻 Best for Individual Users | 💻💻💻 Best for Enterprises |
| Method 1: Adding Wi-Fi profile via netsh wlan and XML | ✓ | ✓ |
| Method 2: Adding a hidden network profile | ✓ | ✓ |
| Method 3: Verify or list saved profiles | ✓ | ✓ |
| Method 4: PowerShell to apply a Wi-Fi profile | ✓ | ✓ |
💡Note: These methods do not require the device to be in range or connected to the network.
Method 1: Add a Wi-Fi profile using netsh wlan and XML
This method lets you manually define a Wi-Fi network configuration using an XML file, then import it via the netsh wlan command.
📌 Use Cases:
- This is helpful for preparing laptops for remote sites where the network they will connect with is not in range.
- This is ideal for automating Wi-Fi setup during onboarding.
📌 Prerequisites:
- This requires you to run the Command Prompt with administrator privileges.
- Ensure you have the following information: SSID, Security type, encryption method, and password.
Here are the steps to add a Wi-Fi network without connecting via netsh wlan and XML:
- First, create an XML Wi-Fi profile by copying and pasting the following into Notepad:
<?xml version="1.0"?><WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"><name>ExampleWiFi</name><SSIDConfig><SSID><name>ExampleWiFi</name></SSID></SSIDConfig><connectionType>ESS</connectionType><connectionMode>manual</connectionMode><MSM><security><authEncryption><authentication>WPA2PSK</authentication><encryption>AES</encryption><useOneX>false</useOneX></authEncryption><sharedKey><keyType>passPhrase</keyType><protected>false</protected><keyMaterial>yourPasswordHere</keyMaterial></sharedKey></security></MSM></WLANProfile>
- In the code, replace ExampleWiFi with your network name (SSID) and yourPasswordHere with the correct password.
- Next, save the file as wifi.xml to an accessible location, like your desktop.
- After this, open the Command Prompt as an Administrator.
- Add the Wi-Fi profile by running this command:
netsh wlan add profile filename="C:\Path\To\wifi.xml"
Replace the path with the actual location of your XML file, which you can obtain via the address bar on File Explorer.
💡 Note: This method creates a Wi-Fi profile without the need for connecting. The device will connect automatically once the network is in range, though this depends on the connection settings in your XML.
Method 2: How to add a hidden Wi-Fi network profile
This enables you to create a Wi-Fi profile for hidden or unsecured networks by modifying the XML file utilized in Method 1.
📌 Use Cases:
- This method is useful for connecting to hidden networks that do not broadcast their SSID.
- Best for offices, conferences, and guest setups that use open/unsecured Wi-Fi.
📌 Prerequisites:
- Requires administrator privileges.
- To execute, you must know the exact SSID of the network.
Here are the steps for adding a hidden Wi-Fi network profile:
- Open Notepad and create the XML file. Copy and paste this command:
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>HiddenSSID</name>
<SSIDConfig>
<SSID>
<name>HiddenSSID</name>
</SSID>
<nonBroadcast>true</nonBroadcast>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>manual</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>open</authentication>
<encryption>none</encryption>
<useOneX>false</useOneX>
</authEncryption>
</security>
</MSM>
</WLANProfile>
- Replace HiddenSSID with the actual network name.
- Save the XML file with something relevant, like HiddenWiFi.xml, and place it in an accessible location.
- Next, open Command Prompt (Administrator).
- Import the profile. Copy and paste this code into the Command Prompt:
netsh wlan add profile filename="C:\Path\To\HiddenWiFi.xml"
Replace C:\Path\To\HiddenWiFi.xml with the XML file’s actual location.
💡 Notes:
- The <nonBroadcast>true</nonBroadcast> is required for hidden networks.
- This method tweaks your system to recognize and connect to a hidden or open network as soon as it is detected. Users won’t need to connect manually.
Method 3: How to verify the list of saved Wi-Fi profiles
After adding a Wi-Fi profile, you can use netsh commands to confirm it was successfully saved.
📌 Use Cases:
- You can use this to confirm if a profile was saved or created correctly.
- This method is excellent for troubleshooting why a specific device is not connecting to a known network.
- This method can also be used if you’re planning to backup and restore Wi-Fi profiles.
📌 Prerequisites:
- This method requires administrator privileges to view saved keys.
- You need to know the profile name to view the settings.
Here is how to verify the list of saved Wi-Fi networks:
- Open the Command Prompt (Administrator).
- To view all saved profiles, run this command:
netsh wlan show profiles
- Meanwhile, to view the details for a specific profile, run this command:
netsh wlan show profile name="ExampleWiFi" key=clear
Replace “ExampleWiFi” with the actual profile name
- Check the inputs and see whether the Wi-Fi profiles were added correctly.
Method 4: How to use PowerShell to add a Wi-Fi profile without connecting to it
PowerShell can run netsh commands to manage Wi-Fi profiles, which is ideal for automation and deployment scenarios where you want to add a network profile across a fleet of computers.
📌 Use Cases:
- Suitable for provisioning scripts or preparing devices for shipment.
- You can use this method in automated setup tools, like Intune, that IT teams use to configure many devices at once.
📌 Prerequisite:
- This requires PowerShell to run as an administrator.
Here are the steps:
- Save your Wi-Fi profile as an XML file (see Method 1).
- Open PowerShell (Administrator).
- Run this command to add the profile:
Start-Process netsh -ArgumentList 'wlan add profile filename="C:\Profiles\ExampleWiFi.xml"' -Verb RunAs
Replace “C:\Profiles\ExampleWiFi.xml” with the location of your XML file.
⚠️ Things to look out for
| Risks | Potential Consequences | Reversals |
| Incorrect SSID or password | The profile won’t connect when the network is in range. | Edit the XML and rerun the command with the corrected details. |
| XML formatting errors | Netsh will be unable to import the profile. | Validate XML; use the commands above. |
| Hidden SSID not marked properly | The device won’t auto-detect even if the network is in range. | Ensure the line <nonBroadcast>true</nonBroadcast> is present in the XML file. |
Additional considerations when adding a Wi-Fi network profile without connecting to Windows 11
Setting auto-connect behavior
You can set a Wi-Fi profile to connect automatically by changing <connectionmode> in the XML to <connectionMode>auto</connectionMode>. This will ensure the device connects as soon as the network is in range.
Security settings need to match the network
Ensure your XML file includes the correct security type (WPA2PSK, WPA3SAE, etc.) and encryption method (AES, TKIP). If these do not match, the profile will fail to connect.
Installing a Wi-Fi profile for all users
By default, profiles are added per user. If you want to install a profile for all users on the device, add this to your netsh command when importing via the Command Prompt:
netsh wlan add profile filename="wifi.xml"user=all
Configuring roaming profiles
These methods can be used to preconfigure roaming Wi-Fi profiles. This will enable mobile users to connect seamlessly at remote offices, branches, or other known locations.
Using methods with automated deployment tools
You can use these methods with tools like Windows Autopilot, sysrep, and answer files, making it ideal for large-scale and scripted deployments.
Preload Wi-Fi profiles to simplify setup and onboarding
Preloading or adding a Wi-Fi network via an XML file is an efficient and straightforward way to prepare devices before they are deployed or delivered.
The methods listed above enable you to add profiles for known networks regardless of whether they are hidden, deployed, secured, or open without connecting immediately. This reduces setup time, eases onboarding, prevents user misconfiguration, and ensures seamless connectivity once the device goes online.
Related topics:
- How to Change Wireless Network Connection Priority Order in Windows
- How to See a List of Wireless Network Profiles in Windows 11
- How to Backup and Restore Wireless Network Profiles in Windows 10
- What Is Wi-Fi Enhanced Open?
- How to Restrict Background Data Usage for Wi-Fi and Ethernet in Windows
Quick-Start Guide
Adding a Wi-Fi Network Profile in NinjaOne:
For Android devices, NinjaOne offers two primary methods to add a Wi-Fi Network Profile:
- During Device Enrollment:
- You can add Wi-Fi to the policy and deploy it after device enrollment
- The policy can push configured networks to the device during provisioning
- For Android Enterprise, you can embed Wi-Fi details directly into the QR code during setup
- Manual Wi-Fi Configuration:
- You can manually configure Wi-Fi networks in the Android MDM policy
- Supports various security types like WPA
- Allows specifying SSID, security type, and password
Key Considerations:
- Works best with new or factory-reset devices
- Supports different deployment methods like preinstalled or required installation
- Can be configured at the policy level for multiple devices
