Author Posts

April 29, 2015 at 3:57 am

I'm trying to modify multiple NIC properties in one go. So having a table of properties I'm interested in I pipe it to set-netAdapterBinding in this case

Get-NetAdapterBinding E*1).Enable gives me which ComponentID is anabled for a particular adapter and which is not. So then I try
@("ms_tcpip6","ms_pacer") | foreach-object {(Set-NetAdapterBinding}.Enabled = $false

Obviously it doesn't work but I'm not sure why? Could someone help please?

April 29, 2015 at 4:12 am

Hi Jarek,

Please try below:

Get-NetAdapterBinding -Name E* -ComponentID 'ms_tcpip6','ms_pacer' | ForEach-Object {
    if (-not $PSItem.Enabled) {
        $PSItem | Set-NetAdapterBinding -Enabled:$false
    }
}

Best,
Daniel

April 29, 2015 at 4:14 am

It looks like you need to specify the parameter by name.

-ComponentID
Specifies the underlying name of the transport or filter in the following
form.
  ?  ms_xxxx, such as ms_tcpip.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

Get-NetAdapterBinding | Set-NetAdapterBinding -ComponentID ms_tcpip6,ms_pacer

April 29, 2015 at 4:17 am

Thanks Daniel. It doesn't throw any erros back at me but it doesn't change anything either for some reason. That is the values remain True after running the script.

April 29, 2015 at 4:31 am

After commenting out the if condition it worked but not sure why again 🙂