Announcement

Collapse
No announcement yet.

PS to Disable NIC's that are Disconnected

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PS to Disable NIC's that are Disconnected

    I am looking to make a script to detect all NIC's on the machine, then if "Disconnect" I want to disable those.

    Any Ideas?

  • #2
    Re: PS to Disable NIC's that are Disconnected

    You haven't said which OS it is, but for 2012 there are a lot of cmdlets:
    http://technet.microsoft.com/en-us/l...=wps.620).aspx

    If you use Get-NetAdapter -physical | where status -eq 'up' this will give you connected ones
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: PS to Disable NIC's that are Disconnected

      Sorry for that. This is for Windows 7. I have about 6 Network Adapters that are detected, and I am only using 2. I need to disable the other 4. I am trying to script this for 100+ machines and they are using the all same adapter. So i need a script to detect the nic to be "unplugged" then disable it.

      Comment


      • #4
        Re: PS to Disable NIC's that are Disconnected

        OK, Win 7 has less powershell, but there should be scripts (Probably VBS) to do the same. This looks like a good starting point:
        http://technet.microsoft.com/en-us/l.../ee692585.aspx
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment

        Working...
        X