r/PowerShell • • Jan 06 '26

Creating a powershell script that toggle IPv6

Hello ,

I want to ask if i can write a script and make it run automatically when windows start to enable ipv6 if it disabled or disable it if enabled because i have a problem , computers can't read domain and show undefiend network so it takes long time to signout .

0 Upvotes

19 comments sorted by

View all comments

Show parent comment

-3

u/LegitimateEye8153 Jan 06 '26

i don't use ipv6 i use ipv4 so toggling ipv6 just for make any reset in network to read the domain

5

u/anditails Jan 06 '26

Either your network DHCP gives out IPv6 addresses or it doesn't. If it does, you should look at sorting IPv6 on the domain. If it doesn't, toggling IPv6 on the network adapter won't solve anything.

Perhaps you're thinking of a winsock reset? That's a simple command line of

netsh winsock reset

But again, this sounds like you need to resolve the underlying network issues rather than sticky-plaster fix every machine.

1

u/purplemonkeymad Jan 06 '26

The default settings, on windows, won't use ipv6 for the domain if you don't get router advertisements or have dhcpv6 setup. If you have something putting out router advertisements you either need to disable that or configure a ula & dns for your domain network.