Few of the articles are posted as Images, Please use Laptop / Computers to go through the articles for best experience. For phone users, switch to Web Version

Please Share with your colleagues if you found these blogs informative. Happy Learning :-)

Powershell Script - Disabling IPv6 on Windows Servers

<#Created By Abhishek Bansal

Read Note 

Script Usage :: Disabling IPv6 under TCP/IP for a NIC Card.

Pre requisites :: Copy all the code into a text file, save it with an extension ".PS1". On same location create a text file named "InputServers.txt" which will be containing names of machines. Once saved, run script as Administrator.

Execution & Outputs :: Once executed Output will be saved in a file named "Postresults_.csv" and any Errors into "Errorslogs.csv" onto same location.#>


$servers = Get-Content .\InputServers.txt

$filename = "Postresults_"+ $(Get-Date -Format "dd_MM_yyy")+".csv"

foreach($server in $servers)

{

$Error.Clear()

    try{

    Invoke-Command -ComputerName $server -ErrorAction Stop -ScriptBlock{Disable-NetAdapterBinding -Name * -ComponentID ms_tcpip6}

    Invoke-Command -ComputerName $server  -ScriptBlock{Get-NetAdapterBinding | Where-Object ComponentID -EQ 'ms_tcpip6'} | `

    Select-Object -Property @{n="Hostname";e={$server}},@{n="Adapter";e={$_.Name}},Displayname,Enabled | Export-Csv ./$filename -Append -NoTypeInformation

    }

    catch{

    $server | Select-Object -Property @{n="Hostname";e={$server}},@{n="ErrorMessage";e={$Error.exception.Message}} | Export-Csv ./Errorlogs.csv -NoTypeInformation -Append

    }

}

# Below option under TCP/IP will be unchecked post executing this script.