New wireless connection Windows 10

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 8 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
WSUsoftware
Posts: 30
Last visit: Thu Feb 17, 2022 2:52 pm

New wireless connection Windows 10

Post by WSUsoftware »

Product, version and build: PS Studio 2016, 5.2.117
32 or 64 bit version of product: 64bit
Operating system: Windows 10
32 or 64 bit OS: 64bit

I am trying to write a very small powershell script, most likely less than 10 lines to connect to a new wireless network and connect via username and password since this is an enterprise setting. Currently what I have is the following, it gets very close. It adds the wireless network profile from the xml file and then connects to it. The part I need help with is I have to physically click the wireless icon in windows 10 for it to then prompt for the credentials required to connect. Is there a way to make it prompt for username and password immediately after "connecting"?

netsh wlan add profile filename="filepath\profile.xml"
netsh wlan connect name="ProfileName"
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: New wireless connection Windows 10

Post by jvierra »

User avatar
WSUsoftware
Posts: 30
Last visit: Thu Feb 17, 2022 2:52 pm

Re: New wireless connection Windows 10

Post by WSUsoftware »

I use the commands in that link to "connect". It says connection successfully completed but then it won't prompt the user for login credentials to authenticate automatically. Once you just physically click on this icon it automatically brings up the window for wireless credentials and once they are entered it successfully is connected wirelessly.

Image
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: New wireless connection Windows 10

Post by jvierra »

Sorry the best you can do is to store the credentials in Windows and they should be automatically used.

Did you read the whole article? You can specify using stored credentials in the profile.
User avatar
WSUsoftware
Posts: 30
Last visit: Thu Feb 17, 2022 2:52 pm

Re: New wireless connection Windows 10

Post by WSUsoftware »

Unfortunately I can't use stored credentials. This is being used as part of a laptop personalization process for new users. They have credentials to connect to the Wireless Profile/Network as part of Group Policy. I used the "netsh wlan add profile filepath="filepath.xml" to add the new network connection and then the "netsh wlan connect name="profile" to connect to that network. Then the user is supposed to enter their network username and password to connect to the network I just added and from that point several other scripts kick off after. The goal of this being that the entire process is automatic up until the username and password is physically typed. It sounds like this isn't possible then?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: New wireless connection Windows 10

Post by jvierra »

I am sure there is a way but it doesn't seem to be published.


Try asking in the Microsoft networking forum.
This topic is 8 years and 3 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked