Jump to content
View in the app

A better way to browse. Learn more.

WinCert.net Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm running Windows Server 2016, All Servers in domain obtain IP address automatically and DNS addresses are set manual: Primary DNS 172.16.0.1 Secondary DNS 172.16.0.2 I create a 3rd DC (172.16.0.3) and promote it as Primary DC (Move all FSMO roles successfully). I want to change the primary DNS on all servers (about 50) to the new PDC 172.16.0.3 So I create a batch file with the following script:

@echo off
set dnsserver=172.16.0.3
set dnsserver2=172.16.0.1
for /f "tokens=1,2,3*" %%i in ('netsh interface show interface') do (
 if %%i EQU Enabled (
 rem echo change "%%l" : %dnsserver%
 netsh interface ipv4 set dnsserver name="%%l" static %dnsserver% both
 netsh interface ipv4 add dnsserver name="%%l" %dnsserver2% index=2
 )
)

Then I create a GPO and link it to my domain. Computer configuration | Policies | Windows Settings | Scripts | (Startup\Shutdown) | Choose Startup In Scripts Properties I added the batch file.

In Security Filtering for this Group Policy I keep the Authenticated Users, add Domain Admins Group and some servers to test it. I logon to these servers run gpupdate /force but with no luck, GP is not applying the script.

Please I need your help with this matter, just I want to change the DNS IPs on all servers with no restart or logon.

Note: Script is correct, I run it manual as admin and it change the DNS IPS.

  • 1 month later...

We're using this script and it's working great for our environment (Win Servers 2016,2019,2022)

Replace DNS addresses and remove the wins server if you're not using it.

@echo off
set com=
set dnsserver=15.X.X.X
set dnsserver2=15.X.X.X
set winsserver=15.X.X.X
setlocal enableDelayedExpansion
for /f "tokens=1,2,3*" %%i in ('netsh interface show interface') do (
    if %%i EQU Enabled (
        set com=F
        
	if %%l EQU NAS1 (set com=T)
	if %%l EQU NAS2 (set com=T)

	if !com! EQU F (netsh interface ipv4 set dnsserver name="%%l" static %dnsserver% both)
	if !com! EQU F (netsh interface ipv4 add dnsserver name="%%l" %dnsserver2% index=2)
	if !com! EQU F (netsh interface ipv4 set winsserver name="%%l" static %winsserver%)
    )
)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.