Windows 2012 Server + Powershell + registry + disabling IPv6
You can easy disable IPv6 with command:
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters -Name DisabledComponents -PropertyType DWord -Value 0xffffffff
and this is example how to work with registry with powershell.
RDP connection error due certificate Windows 2008R2 WDS + TFTP