One of the cooler features with Windows 8 and 8.1 is the ability to let your settings roam from Device to device. A perfect example of this is your wireless profiles.

Earlier versions of Windows settings for the Wireless configuration were maintained upon each individual computer. The drawback to this of course would be that if I had a new computer, the settings for any Wireless networks would need to be re-configured again each time.

When we sign into Windows 8 and Windows 8.1 with a Microsoft ID (such as Hotmail.com or Live.com) those settings can now float from one computer to the next. This is amazing convenient when I start up on a brand new computer.

I however have stumbled into an interesting challenge. Since my computer now can remember all of these old networks, the list can get rather cluttered and large over time.

For a regular Home user this is not a problem, but for those with a Tablet device roaming from location to location it can be. There are times you may encounter new Wireless networks with the same SSID as previous ones. Generic names such are "wireless" or default vendor names are not uncommon choices.

In my own particular laptop I had a problem which required me to clean out some Wireless profiles. Without Windows PowerShell you can find this out using the NETSH command

NETSH WLAN SHOW PROFILE

This will produce a large list on your screen that may look something similar to this.

clip_image002

In the case of my laptop I found over thirty seven (37) profiles from clients, conferences, my home and even my former employer.

If you need to remove one of these profiles you have two methods to work from. In Windows 8.1 you can choose to access the GUI under Settings/Change PC Settings/Network/Connections and click on "Manage known networks"

clip_image004

Clicking on "Manage known networks" will yield the list of Wireless networks in your laptop configuration. At this point you can click on a name and select the "Forget" button to remove it from your list of wireless profiles.

clip_image006

You can also do this from the command prompt using the NETSH command in this fashion.

NETSH WLAN DELETE PROFILE NAME="Eot-Secondary"

This would delete the Wireless network named Eot-Secondary

The problem we have is trying to delete multiple wireless networks. With both the GUI and the NETSH solution it's still a pretty manual process. Manually select and Network and click "Forget" or Manually type in the Wireless SSID name to remove it using NETSH.

Yet somewhere in the distance I sense a solution using Windows PowerShell. At the VERY least we can build a function to pass the SSID to the NETSH command line. With this in place you could have a CSV file of SSID names to purge them

This is quite easy with a simple function like this

Function Remove-WIFIProfile($SSID)

{

(NETSH WLAN DELETE PROFILE NAME=$SSID)

}

What can now do is clean out old Wireless profiles in this simple format

Remove-WIFIProfile –SSID Eot-Secondary

This is all well and fine but what about that big list the computer has? Is there some way to make that useful?

Ahem…. Windows PowerShell can help there as well. Let's capture the output from the NETSH command to list the wireless profiles first.

$SSIDList=(NETSH WLAN SHOW PROFILE) | Select-String 'All User Profile'

Now we only have the output which contains the lines with the Wireless SSIDs. We can take this output and build a CSV file to store the information.

The first thing we'll do format the output into something we can output directly to a csv.

$SSIDList | Foreach { [pscustomobject]@{SSID=$_.line.substring(27) }}

We can visually verify the output first.

clip_image008

With an EXPORT-CSV added on, we can store this output away into something we can use later.

$SSIDList | Foreach { [pscustomobject]@{SSID=$_.line.substring(27) }} | Export-Csv C:\data\wifi.csv –NoTypeInformation

At this point you'll have a list of all of your wireless profiles which you can sort through and clean with Excel (or Notepad if you are so daring!).

We can then take this cleaned up list and clean up old profiles with our earlier function in this fashion.

Import-Csv C:\data\wifi.csv | Foreach { Remove-WifiProfile –ssid $_.SSID }

You can now proudly smile at your much cleaner list of wireless profiles and a just well done thanks to Windows PowerShell.

Sean

Remember the Power of Shell is in YOU

5443headpatchswitch_851x315_wordpress (2)

Be the Hottest It Person on the Planet!

Fans of the “Patch and Switch” podcast that occurs regular Fridays can now own a really cool T-shirt

Details are here! http://teespring.com/patchandswitch

Reserve price is all of $15 but as more people place orders… the price can drop

Check it out now and don’t forget to check out the Patch and Switch podcast!

Patch and Switch – It’s Friday.  Do you know where your IT Guys are?

(also known as Robert Plant is going to kick my butt for messing with a Classic)

Lyrics to the "Cmdlet Song"

Cmdlets,
Cmdlets,

We come the land of the .Net Code,
Our methods run with Overloads

The Land of Monad gods
Data going Stacks Overflowing
Automate the clusters
Typing and Piping
Redmond now is calling home

Onward we go, modules in hand,
Workflows and CIMs we handle the data land

Cmdlets,
Cmdlets,

We come the land of the .Net Code,
Our methods run with Overloads

The glowing of the screen,
It calls us out for more
One Shell to link the Cloud and floor
We are your Azure lords….

Onward we go, modules in hand,
Workflows and CIMs we handle the data land

We live within the Shell
and the Cmdlets do we trust
And Cim and data objects
our Infrastructure is growing

One Shell to Rule them all
One Shell to Find them
One Shell to see the Objects and Bind them

One Shell to Rule them all
One Shell to Find them
One Shell to see the Objects and Bind them