Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Windows 2008 R2 Server Core machine and would like to disable IPv6 on one of its network adapters. Essentially this if there was a UI:

Adapter properties

Any ideas?

share|improve this question
    
You can do it by unbinding the specific adapter. I don't see a PS script for it, but it shouldn't take too long. –  Theo Apr 8 '11 at 0:25

2 Answers 2

up vote 2 down vote accepted

There's a script for that...now.

Replace Local Area Connection with the name of the adapter. This gets the GUID of that adapter and removes it from the value of the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip6\Linkage\Bind property (uses a temp variable).

PowerShell - Elevated privileges and might require a restart.

$UnbindID = $(Get-WmiObject -Class 'Win32_NetworkAdapter' | Where-Object {$_.NetConnectionID -eq 'Local Area Connection'}).GUID
$LinkageKey = $(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\services\Tcpip6\Linkage').Bind | Select-String -Pattern $UnbindID -NotMatch -SimpleMatch
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\services\Tcpip6\Linkage' -Name 'Bind' -Type MultiString -Value $LinkageKey
share|improve this answer
    
I'm getting the error Select-String : Cannot bind argument to parameter 'Pattern' because it is null.. Here's what the registry looks like at that path. Any ideas? –  Alex Angas Apr 8 '11 at 2:07
    
Odd. I hate to ask the question, but are you sure it's not already disabled? That key is the list of GUIDs for Network Adapters that "bind" to IPv6. That is showing there are none. Deeper into the registry we go! –  Theo Apr 8 '11 at 2:10
    
Check the Export and Route keys (in that same spot in the registry) and see if that GUID appears. If you're not sure which GUID, just type $UnbindID and it should output that value. Let me know. –  Theo Apr 8 '11 at 2:15
    
Rewind - there's something going wrong with the name of the adapter, but I don't know what. sconfig shows this and from PS I see this. So I changed the first line of the script to $UnbindID = $(Get-WmiObject -Class 'Win32_NetworkAdapter' | Where-Object {$_.NetConnectionID -eq 'Intel(R) PRO/1000 MT Network Connection'}).GUID but no value is coming back. –  Alex Angas Apr 8 '11 at 2:38
    
Alright, let's try the non-scripting method. Run Get-WmiObject -Class 'Win32_NetworkAdapter' | Select-Object NetConnectionID,GUID. Look on the screen and find the correct GUID. Next, we need to do some housekeeping. Open regedit (just type regedit at prompt), browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip6\Linkage. Open the value for Export and copy that. Open the value for Bind (now empty) and paste it. With that window still open, remove the line that references the same GUID that you want to remove. Save. Restart. Report. –  Theo Apr 8 '11 at 18:40

Registry hack, unfortunately. Really should be a netsh command, but consistency is not Redmond's forté. (source)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters

Create DWORD: DisabledComponents

Set value to 0xffffffff

share|improve this answer
    
My guess is that this will disable the entire IPv6 stack. Is there any way to disable it for a specific adapter? –  Alex Angas Apr 8 '11 at 0:17
    
@Alex This one's even worse. Modify this multi-string value: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Linkage\Bind, stripping out the line with the GUID for the network card you want to disable. You can find the GUID in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards - Description has a readable name, ServiceName has the GUID. –  Shane Madden Apr 8 '11 at 0:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.