JCJohnson76
asked on
Powershell script to configure DNS setting
Need some help
I need to come up with a Powershell script to change multiple Domain Controllers DNS settings.
Please note: Ip address does not need to change, only dns address & dns search order
Sites 1&,2 should have dns address: 172.16.10.12, 172.16.10.13 (search order test.lab, testb.lab) & Site 3 should have 172.16.10.13, 172.16.10.14, 172.16.10.12 (Search order Testb.lab, Test.lab)
DNS Settings: 172.16.10.12, 172.16.10.13, 172.16.10.14
DNS Search order: Test.lab, TestB.lab
I will like to use either csv(import-csv) or txt(get-content) file will lists all of my DC's. CSV file will likely have columns which lists DNS address, DNS search order, Site Location.
Example
Test.lab
Domain controllers, DC1,DC2,DC3,DC4,DC5,DC6 ,DC7,DC8,DC9
Site 1 - DC1,DC2,DC3
Site 2 - DC4,DC5,DC6
Site 3 - DC7,DC8,DC9
Please note: The reason I list the sites so that I can organize which DC's will receive DNS settings and DNS search order base on its site location.
I need to come up with a Powershell script to change multiple Domain Controllers DNS settings.
Please note: Ip address does not need to change, only dns address & dns search order
Sites 1&,2 should have dns address: 172.16.10.12, 172.16.10.13 (search order test.lab, testb.lab) & Site 3 should have 172.16.10.13, 172.16.10.14, 172.16.10.12 (Search order Testb.lab, Test.lab)
DNS Settings: 172.16.10.12, 172.16.10.13, 172.16.10.14
DNS Search order: Test.lab, TestB.lab
I will like to use either csv(import-csv) or txt(get-content) file will lists all of my DC's. CSV file will likely have columns which lists DNS address, DNS search order, Site Location.
Example
Test.lab
Domain controllers, DC1,DC2,DC3,DC4,DC5,DC6 ,DC7,DC8,DC9
Site 1 - DC1,DC2,DC3
Site 2 - DC4,DC5,DC6
Site 3 - DC7,DC8,DC9
Please note: The reason I list the sites so that I can organize which DC's will receive DNS settings and DNS search order base on its site location.
ASKER
Running 2008 R2 DC's,
Can you provide detail syntax on the setup of this solution,
Thanks for the reply, & getting back to so soon
Can you provide detail syntax on the setup of this solution,
Thanks for the reply, & getting back to so soon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
and another one for DNS and suffixesOpen in new window
Which OS are those DCs running? W8/2012 allows to use some cmdlets, prior OS requires to use e.g. netsh.