Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need script to perform ipconfig /dnsflush & dnsregister commands on multiple servers.

Posted on 2014-04-10
3
Medium Priority
?
932 Views
Last Modified: 2014-04-24
We have added DNS entries in multiple servers however we didn't perform dns flush.

We need script through which we can perform ipconfig /dnsflush  & ipconfig /dnsregister commands on multiple servers at once.
0
Comment
Question by:biplabmukh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 1500 total points
ID: 39992275
If you have winrm running and PS in your envrionment:
gc serverlist.txt | % {
invoke-command -computername $_ -scriptblock {
ipconfig /flushdns
ipconfig /registerdns
}
}

Open in new window


if you do not and you have psexec:
 for /f %a in (serverlist.txt) do psexec \\%a cmd /c ipconfig /flushdns & ipconfig /registerdns
0
 
LVL 29

Assisted Solution

by:becraig
becraig earned 1500 total points
ID: 40013737
Did either of the above commands work for you ?

If you have issues running psexec, it could be permissions issues and you need to add username and password:
e.g.

 for /f %a in (serverlist.txt) do psexec -u domain\user -p password \\%a cmd /c ipconfig /flushdns & ipconfig /registerdns
0
 

Author Closing Comment

by:biplabmukh
ID: 40019529
Above commands helped me partially.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many times while working on a computer regardless of any Operating System, lag and crashes seem to creep in, hindering your working speed. Sometimes, it can also cause your work to be lost unexpectedly and as a result, you are unable to meet your de…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question