Hi,
Sure, you can clear the wifi profile using .bat or .ps1 through GPO. If we use the batch file, only a single command line is required.
netsh wlan delete profile name=<wifi_name>
Regards,
Alex
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Expert,
I am upgrading the machine to Win11 23H2 in our environment using the in-place upgrade method, but after the upgrade, it's not connecting to the corporate Wi-Fi. I also checked that the machine is patched with the latest month's updates. So now, can you provide a script that forgets the corporate Wi-Fi connection? Ideally, it should be some kind of login script that runs only once when a user logs into Win11 after upgrading. Also, would request please test script in your test environment.
Hi,
Sure, you can clear the wifi profile using .bat or .ps1 through GPO. If we use the batch file, only a single command line is required.
netsh wlan delete profile name=<wifi_name>
Regards,
Alex
Hi TechUST,
If you prefer the script run only once, you can use the script below:
$file_result = "c:\even_run.txt"
if (test-path $file_result)
{
write-host "$file_result exists. ignored!"
}
else
{
$command = 'netsh wlan delete profile name=actual_wifi_name'
invoke-expression $command
$str1 = "anything you want to put here"
add-content -path $file_result -value $str1
write-host "wlan profile removed!"
}
Regards,
Alex Zhu