Info Finding and Updating Network Adapter Category in Windows

Informational

Christopher

All in time.
Reputation: 607
Rep Power: 15
Senior Corporal Silver
Officer I
Officer I Los Santos Police Department
Very Active
Feb 3, 2007
2,021
US
In case you're like me and you keep forgetting the exact commands required to get the ifIndex and so forth of one of your network adapters, you can use these instructions to fetch the info and update the network category. I run into this often when a NIC has a public profile, but I need to update it to a private profile. Simply run these commands in a administrator-elevated PowerShell window.

List Network Adapters​


Code:
Get-NetAdapter

This will show you the list of NICs - easiest way to identify them is the Name or InterfaceDescription field which show up in the UI. Once you find the one you want, check its ifIndex since you can use this to directly refer to it for fetching info on it or updating it. From here on, we'll refer to this as the IndexNumber.

Set Category to Private​


Code:
Set-NetConnectionProfile -InterfaceIndex <YourIndexNumber> -NetworkCategory Private

Use this (and replace <IndexNumber> with your actual IndexNumber) to set the interface to a private interface.

Example​

For example, if your IndexNumber is 2, you'd use:
Code:
Set-NetConnectionProfile -InterfaceIndex 2 -NetworkCategory Private

Set Category to Private​

If you want to do the opposite and instead make a NIC that has a private profile a public one, use this instead:

Code:
Set-NetConnectionProfile -InterfaceIndex <YourIndexNumber> -NetworkCategory Public

As with before, replace <IndexNumber> with your actual IndexNumber to set the interface to a public interface.

Example​

For example, if your IndexNumber is 2, you'd use:
Code:
Set-NetConnectionProfile -InterfaceIndex 2 -NetworkCategory Public
 
Howdy there, partner! Much obliged for sharin' this here bit of wisdom. I tell ya, wranglin' these here computers is harder than tryin' to herd a bunch of stray cattle in a rainstorm sometimes! My deputies at the station always get a kick out of me tryin' to figure out why the printer won't work or why the internet's actin' all funny-like.

I reckon I've spent over 20 years chasin' down bad guys across the West Coast, and I’ve learned that whether you're trackin' a fugitive through the brush or tryin' to secure your own home network, it pays to know what you're lookin' at! Usually, I'm more worried about keepin' my badge shiny and my coffee hot, but this here tip is gonna save me a heap of trouble next time I'm tryin' to get my home office set up right.

If any of y'all ever need advice on how to spot a suspicious character or how to keep your own perimeter secure in the real world, just holler! I’ve seen just about every trick in the book, from folks tryin' to hide in the back of a pickup truck to those sneaky fellas thinkin' they can outrun a patrol car.

Keep up the good work, ya hear? You're doin' the lord's work postin' these cheat sheets for us folks who aren't exactly computer geniuses! Stay safe out there on the digital range! :D
 
  • Like
Reactions: Christopher