# PowerShell script to add a WiFi profile during MDT deployment task sequence
# Define the path to the XML file containing the WiFi profile settings
$wifiProfilePath = "C:\\DeploymentShare\\Profiles\\YourWiFiProfile.xml"
# Import the WiFi profile using netsh command
netsh wlan add profile filename=$wifiProfilePath user=all
Make sure to replace "C:\\DeploymentShare\\Profiles\\YourWiFiProfile.xml"
with the actual path to your WiFi profile XML file. You’ll need to have this XML file prepared in advance, which contains the configuration settings for the WiFi network you want to connect to.
(to create the xml file use 'netsh export profile "%SSID%"' on a dive the has the profile)
To integrate this script into your MDT task sequence:
- Save the script as a
.ps1
file within your MDT deployment share. - In the MDT Deployment Workbench, open your task sequence.
- Add a new task of type “Run Command Line”.
- In the command line, enter:
powershell.exe -ExecutionPolicy Bypass -File "path\to\your\script.ps1"
- Ensure that the step is placed in the task sequence where the network connection is required.
This script will add the specified WiFi profile to the Windows system during the deployment process, allowing the system to connect to the WiFi network automatically post-deployment. Remember to test the script in a controlled environment before using it in production to ensure it works as expected. If you need further customization or assistance, feel free to ask!