Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

 

When subscribed to the list you should use your standard email client to send your posts to ActiveDir@mail.activedir.org.

List Archives

Subject: [ActiveDir] OT: Script to set DNS on all DCs
Prev Next
You are not authorized to post a reply.

AuthorMessages
rmscheckUser is Offline

Posts:245

10/13/2009 1:27 PM  
Hey folks..

I was wondering if anyone could help me devise a script that would
change all the primary DNS settings on my DCs to a specific IP. I am
about to do some DNS work (break out _msdcs, and zones) and need to
point them all to one DC. Problem is, I have 65 DCs, and would surely
hate to hit them up one by one....

Then of course, the problem becomes changing them back.. ack!

Anyone face a similar situation?

-Rand.

RickSheikhUser is Offline

Posts:373

10/13/2009 2:51 PM  
NETSH

On Tue, Oct 13, 2009 at 7:25 AM, Rand Salazar <rmscheck08@gmail.com> wrote:

> Hey folks..
>
> I was wondering if anyone could help me devise a script that would
> change all the primary DNS settings on my DCs to a specific IP. I am
> about to do some DNS work (break out _msdcs, and zones) and need to
> point them all to one DC. Problem is, I have 65 DCs, and would surely
> hate to hit them up one by one....
>
> Then of course, the problem becomes changing them back.. ack!
>
> Anyone face a similar situation?
>
> -Rand.
>
>

TGUser is Offline

Posts:298

10/13/2009 3:13 PM  
It is easy if you do not have multihomed Domain Controller, ad did not
mock with the naming of the NIC (or mocked with in a consistent fashion).

netsh interface ipv4 set dnsserver static "Local Area Connection"
xx.xx.xx.xx (for 2008)

netsh interface ip set dnsserver static "Local Area Connection"
xx.xx.xx.xx (for 2003)

But watch out for various things that change the interface name (driver
changes on VMWare, etc...)

You can use something like below to dinamically pull the interface name
(as long as there is only one) or loop through all of them.

Set interfaceFILTERout=Loopback

for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces
^|find /i /v "%interfaceFILTERout%"') do (
for /f "tokens=2 delims==" %%d in ('wmic nicconfig where
interfaceindex^=%%a get index /value') do (
call :DNSSET %%a %%b "%%c" %%d
)
)

:DNSSET

netsh interface ipv4 set dnsserver static "Local Area Connection"
xx.xx.xx.xx


Thank you, Tony.


Tony Gordon
Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
ITS Infrastructure Engineering
Tel 847.295.5000 x37892 | Fax 847.883.7892
tony dot gordon at hewitt dot tld | www.hewitt.com
P Please consider the environment before printing this e-mail.



From:
"Rand Salazar" <rmscheck08@gmail.com>
To:
ActiveDir@mail.activedir.org
Date:
10/13/2009 07:22 AM
Subject:
[ActiveDir] OT: Script to set DNS on all DCs
Sent by:
activedir-owner@mail.activedir.org



Hey folks..

I was wondering if anyone could help me devise a script that would
change all the primary DNS settings on my DCs to a specific IP. I am
about to do some DNS work (break out _msdcs, and zones) and need to
point them all to one DC. Problem is, I have 65 DCs, and would surely
hate to hit them up one by one....

Then of course, the problem becomes changing them back.. ack!

Anyone face a similar situation?

-Rand.







The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by e-mail.



benwayjUser is Offline

Posts:47

10/13/2009 3:19 PM  
with the help of this list I wrote a powershell script to list the DNS
server, shouldn't be to hard to update the script so it changes the DNS
servers.

http://www.savagenomads.net/2009/07/21/powershell_to_get_network_setting
s/

I thought you could use group policy to update DNS servers?

jb

________________________________

From: activedir-owner@mail.activedir.org
[mailto:activedir-owner@mail.activedir.org] On Behalf Of Tony Gordon
Sent: Tuesday, October 13, 2009 10:06 AM
To: activedir@mail.activedir.org
Subject: Re: [ActiveDir] OT: Script to set DNS on all DCs


It is easy if you do not have multihomed Domain Controller, ad did not
mock with the naming of the NIC (or mocked with in a consistent
fashion).

netsh interface ipv4 set dnsserver static "Local Area Connection"
xx.xx.xx.xx (for 2008)

netsh interface ip set dnsserver static "Local Area Connection"
xx.xx.xx.xx (for 2003)

But watch out for various things that change the interface name (driver
changes on VMWare, etc...)

You can use something like below to dinamically pull the interface name
(as long as there is only one) or loop through all of them.

Set interfaceFILTERout=Loopback

for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show
interfaces ^|find /i /v "%interfaceFILTERout%"') do (
for /f "tokens=2 delims==" %%d in ('wmic nicconfig where
interfaceindex^=%%a get index /value') do (
call :DNSSET %%a %%b "%%c" %%d
)
)

:DNSSET

netsh interface ipv4 set dnsserver static "Local Area Connection"
xx.xx.xx.xx


Thank you, Tony.


Tony Gordon
Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
ITS Infrastructure Engineering
Tel 847.295.5000 x37892 | Fax 847.883.7892
tony dot gordon at hewitt dot tld | www.hewitt.com
P Please consider the environment before printing this e-mail.



From: "Rand Salazar" <rmscheck08@gmail.com>
To: ActiveDir@mail.activedir.org
Date: 10/13/2009 07:22 AM
Subject: [ActiveDir] OT: Script to set DNS on all DCs
Sent by: activedir-owner@mail.activedir.org

________________________________




Hey folks..

I was wondering if anyone could help me devise a script that would
change all the primary DNS settings on my DCs to a specific IP. I am
about to do some DNS work (break out _msdcs, and zones) and need to
point them all to one DC. Problem is, I have 65 DCs, and would surely
hate to hit them up one by one....

Then of course, the problem becomes changing them back.. ack!

Anyone face a similar situation?

-Rand.






________________________________


The information contained in this e-mail and any accompanying documents
may contain information that is confidential or otherwise protected from
disclosure. If you are not the intended recipient of this message, or if
this message has been addressed to you in error, please immediately
alert the sender by reply e-mail and then delete this message, including
any attachments. Any dissemination, distribution or other use of the
contents of this message by anyone other than the intended recipient is
strictly prohibited. All messages sent to and from this e-mail address
may be monitored as permitted by applicable law and regulations to
ensure compliance with our internal policies and to protect our
business. E-mails are not secure and cannot be guaranteed to be error
free as they can be intercepted, amended, lost or destroyed, or contain
viruses. You are deemed to have accepted these risks if you communicate
with us by e-mail.


robertsingersUser is Offline

Posts:571

10/13/2009 9:12 PM  
Mocking your NICS, is that like using NETSH with a silly French accent? :)


From: activedir-owner@mail.activedir.org [mailto:activedir-owner@mail.activedir.org] On Behalf Of Tony Gordon
Sent: Wednesday, 14 October 2009 3:06 a.m.
To: activedir@mail.activedir.org
Subject: Re: [ActiveDir] OT: Script to set DNS on all DCs

It is easy if you do not have multihomed Domain Controller, ad did not mock with the naming of the NIC (or mocked with in a consistent fashion).

netsh interface ipv4 set dnsserver static "Local Area Connection" xx.xx.xx.xx (for 2008)

netsh interface ip set dnsserver static "Local Area Connection" xx.xx.xx.xx (for 2003)

But watch out for various things that change the interface name (driver changes on VMWare, etc...)

You can use something like below to dinamically pull the interface name (as long as there is only one) or loop through all of them.

Set interfaceFILTERout=Loopback

for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces ^|find /i /v "%interfaceFILTERout%"') do (
for /f "tokens=2 delims==" %%d in ('wmic nicconfig where interfaceindex^=%%a get index /value') do (
call :DNSSET %%a %%b "%%c" %%d
)
)

:DNSSET

netsh interface ipv4 set dnsserver static "Local Area Connection" xx.xx.xx.xx


Thank you, Tony.


Tony Gordon
Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
ITS Infrastructure Engineering
Tel 847.295.5000 x37892 | Fax 847.883.7892
tony dot gordon at hewitt dot tld | www.hewitt.com
P Please consider the environment before printing this e-mail.

From:

"Rand Salazar" <rmscheck08@gmail.com>

To:

ActiveDir@mail.activedir.org

Date:

10/13/2009 07:22 AM

Subject:

[ActiveDir] OT: Script to set DNS on all DCs

Sent by:

activedir-owner@mail.activedir.org


________________________________



Hey folks..

I was wondering if anyone could help me devise a script that would
change all the primary DNS settings on my DCs to a specific IP. I am
about to do some DNS work (break out _msdcs, and zones) and need to
point them all to one DC. Problem is, I have 65 DCs, and would surely
hate to hit them up one by one....

Then of course, the problem becomes changing them back.. ack!

Anyone face a similar situation?

-Rand.



________________________________

The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by e-mail.
________________________________
This e-mail message has been scanned for Viruses and cleared by NetIQ MailMarshal
________________________________

############################################################
PLEASE NOTE:

The information contained in this email message and any
attached files may be confidential and subject to privilege.
Any opinions expressed in this message are not necessarily
those of the Department of Building and Housing. All technical
opinions are offered on a ?no-liability? basis. This message
and any files transmitted with it are confidential and solely
for the use of the intended recipient. If you are not the
intended recipient, you are notified that any use, disclosure
or copying of this email is unauthorised. If you have received
this email in error, please notify us immediately by reply email
and delete the original and any attachment(s). Thank you.
############################################################

andrewUser is Offline

Posts:77

10/13/2009 9:24 PM  
A good case here for assigning servers (including DCs) DHCP reservations.
2009/10/13 Robert Singers <Robert.Singers@dbh.govt.nz>

> Mocking your NICS, is that like using NETSH with a silly French accent? J
>
>
>
>
>
> *From:* activedir-owner@mail.activedir.org [mailto:
> activedir-owner@mail.activedir.org] *On Behalf Of *Tony Gordon
> *Sent:* Wednesday, 14 October 2009 3:06 a.m.
>
> *To:* activedir@mail.activedir.org
> *Subject:* Re: [ActiveDir] OT: Script to set DNS on all DCs
>
>
>
> It is easy if you do not have multihomed Domain Controller, ad did not mock
> with the naming of the NIC (or mocked with in a consistent fashion).
>
> netsh interface ipv4 set dnsserver static "Local Area Connection"
> xx.xx.xx.xx (for 2008)
>
> netsh interface ip set dnsserver static "Local Area Connection" xx.xx.xx.xx
> (for 2003)
>
> But watch out for various things that change the interface name (driver
> changes on VMWare, etc...)
>
> You can use something like below to dinamically pull the interface name (as
> long as there is only one) or loop through all of them.
>
> Set interfaceFILTERout=Loopback
>
> for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces
> ^|find /i /v "%interfaceFILTERout%"') do (
> for /f "tokens=2 delims==" %%d in ('wmic nicconfig where
> interfaceindex^=%%a get index /value') do (
> call :DNSSET %%a %%b "%%c" %%d
> )
> )
>
> :DNSSET
>
> netsh interface ipv4 set dnsserver static "Local Area Connection"
> xx.xx.xx.xx
>
>
> Thank you, Tony.
>
> *
> Tony Gordon*
> Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
> ITS Infrastructure Engineering
> Tel 847.295.5000 x37892 | Fax 847.883.7892
> tony dot gordon at hewitt dot tld | www.hewitt.com
> P Please consider the environment before printing this e-mail.
>
> From:
>
> "Rand Salazar" <rmscheck08@gmail.com>
>
> To:
>
> ActiveDir@mail.activedir.org
>
> Date:
>
> 10/13/2009 07:22 AM
>
> Subject:
>
> [ActiveDir] OT: Script to set DNS on all DCs
>
> Sent by:
>
> activedir-owner@mail.activedir.org
>
>
> ------------------------------
>
>
>
>
> Hey folks..
>
> I was wondering if anyone could help me devise a script that would
> change all the primary DNS settings on my DCs to a specific IP. I am
> about to do some DNS work (break out _msdcs, and zones) and need to
> point them all to one DC. Problem is, I have 65 DCs, and would surely
> hate to hit them up one by one....
>
> Then of course, the problem becomes changing them back.. ack!
>
> Anyone face a similar situation?
>
> -Rand.
>
>
>
> ------------------------------
>
>
> The information contained in this e-mail and any accompanying documents may
> contain information that is confidential or otherwise protected from
> disclosure. If you are not the intended recipient of this message, or if
> this message has been addressed to you in error, please immediately alert
> the sender by reply e-mail and then delete this message, including any
> attachments. Any dissemination, distribution or other use of the contents of
> this message by anyone other than the intended recipient is strictly
> prohibited. All messages sent to and from this e-mail address may be
> monitored as permitted by applicable law and regulations to ensure
> compliance with our internal policies and to protect our business. E-mails
> are not secure and cannot be guaranteed to be error free as they can be
> intercepted, amended, lost or destroyed, or contain viruses. You are deemed
> to have accepted these risks if you communicate with us by e-mail.
> ------------------------------
>
> This e-mail message has been scanned for Viruses and cleared by *NetIQ
> MailMarshal *
> ------------------------------
>
> ------------------------------
> *Please Note: *
>
> The information contained in this email message and any attached files may
> be confidential and subject to privilege. Any opinions expressed in this
> message are not necessarily those of the Department of Building and Housing.
> All technical opinions are offered on a ‘no-liability’ basis. This message
> and any files transmitted with it are confidential and solely for the use of
> the intended recipient. If you are not the intended recipient, you are
> notified that any use, disclosure or copying of this email is unauthorised.
> If you have received this email in error, please notify us immediately by
> reply email and delete the original and any attachment(s). Thank you.
> ------------------------------
>
>

RickSheikhUser is Offline

Posts:373

10/13/2009 9:30 PM  
I would be curious to know how many people have DHCP reservations for their
DCs.

On Tue, Oct 13, 2009 at 3:23 PM, Andrew Levicki <andrew@levicki.me.uk>wrote:

> A good case here for assigning servers (including DCs) DHCP reservations.
> 2009/10/13 Robert Singers <Robert.Singers@dbh.govt.nz>
>
> Mocking your NICS, is that like using NETSH with a silly French accent?
>> J
>>
>>
>>
>>
>>
>> *From:* activedir-owner@mail.activedir.org [mailto:
>> activedir-owner@mail.activedir.org] *On Behalf Of *Tony Gordon
>> *Sent:* Wednesday, 14 October 2009 3:06 a.m.
>>
>> *To:* activedir@mail.activedir.org
>> *Subject:* Re: [ActiveDir] OT: Script to set DNS on all DCs
>>
>>
>>
>> It is easy if you do not have multihomed Domain Controller, ad did not
>> mock with the naming of the NIC (or mocked with in a consistent fashion)..
>>
>> netsh interface ipv4 set dnsserver static "Local Area Connection"
>> xx.xx.xx.xx (for 2008)
>>
>> netsh interface ip set dnsserver static "Local Area Connection"
>> xx.xx.xx.xx (for 2003)
>>
>> But watch out for various things that change the interface name (driver
>> changes on VMWare, etc...)
>>
>> You can use something like below to dinamically pull the interface name
>> (as long as there is only one) or loop through all of them.
>>
>> Set interfaceFILTERout=Loopback
>>
>> for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces
>> ^|find /i /v "%interfaceFILTERout%"') do (
>> for /f "tokens=2 delims==" %%d in ('wmic nicconfig where
>> interfaceindex^=%%a get index /value') do (
>> call :DNSSET %%a %%b "%%c" %%d
>> )
>> )
>>
>> :DNSSET
>>
>> netsh interface ipv4 set dnsserver static "Local Area Connection"
>> xx.xx.xx.xx
>>
>>
>> Thank you, Tony.
>>
>> *
>> Tony Gordon*
>> Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
>> ITS Infrastructure Engineering
>> Tel 847.295.5000 x37892 | Fax 847.883.7892
>> tony dot gordon at hewitt dot tld | www.hewitt.com
>> P Please consider the environment before printing this e-mail.
>>
>> From:
>>
>> "Rand Salazar" <rmscheck08@gmail.com>
>>
>> To:
>>
>> ActiveDir@mail.activedir.org
>>
>> Date:
>>
>> 10/13/2009 07:22 AM
>>
>> Subject:
>>
>> [ActiveDir] OT: Script to set DNS on all DCs
>>
>> Sent by:
>>
>> activedir-owner@mail.activedir.org
>>
>>
>> ------------------------------
>>
>>
>>
>>
>> Hey folks..
>>
>> I was wondering if anyone could help me devise a script that would
>> change all the primary DNS settings on my DCs to a specific IP. I am
>> about to do some DNS work (break out _msdcs, and zones) and need to
>> point them all to one DC. Problem is, I have 65 DCs, and would surely
>> hate to hit them up one by one....
>>
>> Then of course, the problem becomes changing them back.. ack!
>>
>> Anyone face a similar situation?
>>
>> -Rand.
>>
>>
>>
>> ------------------------------
>>
>>
>> The information contained in this e-mail and any accompanying documents
>> may contain information that is confidential or otherwise protected from
>> disclosure. If you are not the intended recipient of this message, or if
>> this message has been addressed to you in error, please immediately alert
>> the sender by reply e-mail and then delete this message, including any
>> attachments. Any dissemination, distribution or other use of the contents of
>> this message by anyone other than the intended recipient is strictly
>> prohibited. All messages sent to and from this e-mail address may be
>> monitored as permitted by applicable law and regulations to ensure
>> compliance with our internal policies and to protect our business. E-mails
>> are not secure and cannot be guaranteed to be error free as they can be
>> intercepted, amended, lost or destroyed, or contain viruses. You are deemed
>> to have accepted these risks if you communicate with us by e-mail.
>> ------------------------------
>>
>> This e-mail message has been scanned for Viruses and cleared by *NetIQ
>> MailMarshal *
>> ------------------------------
>>
>> ------------------------------
>> *Please Note: *
>>
>> The information contained in this email message and any attached files may
>> be confidential and subject to privilege. Any opinions expressed in this
>> message are not necessarily those of the Department of Building and Housing.
>> All technical opinions are offered on a ‘no-liability’ basis. This message
>> and any files transmitted with it are confidential and solely for the use of
>> the intended recipient. If you are not the intended recipient, you are
>> notified that any use, disclosure or copying of this email is unauthorised.
>> If you have received this email in error, please notify us immediately by
>> reply email and delete the original and any attachment(s). Thank you.
>> ------------------------------
>>
>>
>

TGUser is Offline

Posts:298

10/13/2009 9:34 PM  
I usually stick with Russian accent, but that is just me. French would
work just as well. :)

Thank you, Tony.


Tony Gordon
Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
ITS Infrastructure Engineering
Tel 847.295.5000 x37892 | Fax 847.883.7892
tony dot gordon at hewitt dot tld | www.hewitt.com
P Please consider the environment before printing this e-mail.



From:
"Robert Singers" <Robert.Singers@dbh.govt.nz>
To:
"activedir@mail.activedir.org" <activedir@mail.activedir.org>
Date:
10/13/2009 03:08 PM
Subject:
RE: [ActiveDir] OT: Script to set DNS on all DCs
Sent by:
activedir-owner@mail.activedir.org



Mocking your NICS, is that like using NETSH with a silly French accent? J


From: activedir-owner@mail.activedir.org [
mailto:activedir-owner@mail.activedir.org] On Behalf Of Tony Gordon
Sent: Wednesday, 14 October 2009 3:06 a.m.
To: activedir@mail.activedir.org
Subject: Re: [ActiveDir] OT: Script to set DNS on all DCs

It is easy if you do not have multihomed Domain Controller, ad did not
mock with the naming of the NIC (or mocked with in a consistent fashion).

netsh interface ipv4 set dnsserver static "Local Area Connection"
xx.xx.xx.xx (for 2008)

netsh interface ip set dnsserver static "Local Area Connection"
xx.xx.xx.xx (for 2003)

But watch out for various things that change the interface name (driver
changes on VMWare, etc...)

You can use something like below to dinamically pull the interface name
(as long as there is only one) or loop through all of them.

Set interfaceFILTERout=Loopback

for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces
^|find /i /v "%interfaceFILTERout%"') do (
for /f "tokens=2 delims==" %%d in ('wmic nicconfig where
interfaceindex^=%%a get index /value') do (
call :DNSSET %%a %%b "%%c" %%d
)
)

:DNSSET

netsh interface ipv4 set dnsserver static "Local Area Connection"
xx.xx.xx.xx


Thank you, Tony.


Tony Gordon
Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
ITS Infrastructure Engineering
Tel 847.295.5000 x37892 | Fax 847.883.7892
tony dot gordon at hewitt dot tld | www.hewitt.com
P Please consider the environment before printing this e-mail.


From:
"Rand Salazar" <rmscheck08@gmail.com>
To:
ActiveDir@mail.activedir.org
Date:
10/13/2009 07:22 AM
Subject:
[ActiveDir] OT: Script to set DNS on all DCs
Sent by:
activedir-owner@mail.activedir.org





Hey folks..

I was wondering if anyone could help me devise a script that would
change all the primary DNS settings on my DCs to a specific IP. I am
about to do some DNS work (break out _msdcs, and zones) and need to
point them all to one DC. Problem is, I have 65 DCs, and would surely
hate to hit them up one by one....

Then of course, the problem becomes changing them back.. ack!

Anyone face a similar situation?

-Rand.





The information contained in this e-mail and any accompanying documents
may contain information that is confidential or otherwise protected from
disclosure. If you are not the intended recipient of this message, or if
this message has been addressed to you in error, please immediately alert
the sender by reply e-mail and then delete this message, including any
attachments. Any dissemination, distribution or other use of the contents
of this message by anyone other than the intended recipient is strictly
prohibited. All messages sent to and from this e-mail address may be
monitored as permitted by applicable law and regulations to ensure
compliance with our internal policies and to protect our business. E-mails
are not secure and cannot be guaranteed to be error free as they can be
intercepted, amended, lost or destroyed, or contain viruses. You are
deemed to have accepted these risks if you communicate with us by e-mail.

This e-mail message has been scanned for Viruses and cleared by NetIQ
MailMarshal

Please Note:
The information contained in this email message and any attached files may
be confidential and subject to privilege. Any opinions expressed in this
message are not necessarily those of the Department of Building and
Housing. All technical opinions are offered on a ?no-liability? basis.
This message and any files transmitted with it are confidential and solely
for the use of the intended recipient. If you are not the intended
recipient, you are notified that any use, disclosure or copying of this
email is unauthorised. If you have received this email in error, please
notify us immediately by reply email and delete the original and any
attachment(s). Thank you.




The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by e-mail.



hcolemanUser is Offline

Posts:129

10/13/2009 9:34 PM  
Kind of depends on who manages the DHCP service <g>

From: activedir-owner@mail.activedir.org [mailto:activedir-owner@mail.activedir.org] On Behalf Of Andrew Levicki
Sent: Tuesday, October 13, 2009 2:24 PM
To: activedir@mail.activedir.org
Subject: Re: [ActiveDir] OT: Script to set DNS on all DCs

A good case here for assigning servers (including DCs) DHCP reservations.

2009/10/13 Robert Singers <Robert.Singers@dbh.govt.nz<mailto:Robert.Singers@dbh.govt.nz>>
Mocking your NICS, is that like using NETSH with a silly French accent? :)


From: activedir-owner@mail.activedir.org<mailto:activedir-owner@mail.activedir.org> [mailto:activedir-owner@mail.activedir.org<mailto:activedir-owner@mail.activedir.org>] On Behalf Of Tony Gordon
Sent: Wednesday, 14 October 2009 3:06 a.m.

To: activedir@mail.activedir.org<mailto:activedir@mail.activedir.org>
Subject: Re: [ActiveDir] OT: Script to set DNS on all DCs

It is easy if you do not have multihomed Domain Controller, ad did not mock with the naming of the NIC (or mocked with in a consistent fashion).

netsh interface ipv4 set dnsserver static "Local Area Connection" xx.xx.xx.xx (for 2008)

netsh interface ip set dnsserver static "Local Area Connection" xx.xx.xx.xx (for 2003)

But watch out for various things that change the interface name (driver changes on VMWare, etc...)

You can use something like below to dinamically pull the interface name (as long as there is only one) or loop through all of them.

Set interfaceFILTERout=Loopback

for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces ^|find /i /v "%interfaceFILTERout%"') do (
for /f "tokens=2 delims==" %%d in ('wmic nicconfig where interfaceindex^=%%a get index /value') do (
call :DNSSET %%a %%b "%%c" %%d
)
)

:DNSSET

netsh interface ipv4 set dnsserver static "Local Area Connection" xx.xx.xx.xx


Thank you, Tony.


Tony Gordon
Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
ITS Infrastructure Engineering
Tel 847.295.5000 x37892 | Fax 847.883.7892
tony dot gordon at hewitt dot tld | www.hewitt.com<http://www.hewitt.com>
P Please consider the environment before printing this e-mail.
From:

"Rand Salazar" <rmscheck08@gmail.com<mailto:rmscheck08@gmail.com>>

To:

ActiveDir@mail.activedir.org<mailto:ActiveDir@mail.activedir.org>

Date:

10/13/2009 07:22 AM

Subject:

[ActiveDir] OT: Script to set DNS on all DCs

Sent by:

activedir-owner@mail.activedir.org<mailto:activedir-owner@mail.activedir.org>


________________________________



Hey folks..

I was wondering if anyone could help me devise a script that would
change all the primary DNS settings on my DCs to a specific IP. I am
about to do some DNS work (break out _msdcs, and zones) and need to
point them all to one DC. Problem is, I have 65 DCs, and would surely
hate to hit them up one by one....

Then of course, the problem becomes changing them back.. ack!

Anyone face a similar situation?

-Rand.


________________________________

The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by e-mail.
________________________________
This e-mail message has been scanned for Viruses and cleared by NetIQ MailMarshal
________________________________
________________________________
Please Note:

The information contained in this email message and any attached files may be confidential and subject to privilege. Any opinions expressed in this message are not necessarily those of the Department of Building and Housing. All technical opinions are offered on a 'no-liability' basis. This message and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient, you are notified that any use, disclosure or copying of this email is unauthorised. If you have received this email in error, please notify us immediately by reply email and delete the original and any attachment(s). Thank you.

________________________________


mck1012@gmail.comUser is Offline

Posts:35

10/13/2009 9:52 PM  
I would say 1





On Tue, Oct 13, 2009 at 4:27 PM, Rick Sheikh <ricksheikh@gmail.com> wrote:

> I would be curious to know how many people have DHCP reservations for their
> DCs.
>
>
> On Tue, Oct 13, 2009 at 3:23 PM, Andrew Levicki <andrew@levicki.me.uk>wrote:
>
>> A good case here for assigning servers (including DCs) DHCP reservations..
>> 2009/10/13 Robert Singers <Robert.Singers@dbh.govt.nz>
>>
>> Mocking your NICS, is that like using NETSH with a silly French accent?
>>> J
>>>
>>>
>>>
>>>
>>>
>>> *From:* activedir-owner@mail.activedir.org [mailto:
>>> activedir-owner@mail.activedir.org] *On Behalf Of *Tony Gordon
>>> *Sent:* Wednesday, 14 October 2009 3:06 a.m.
>>>
>>> *To:* activedir@mail.activedir.org
>>> *Subject:* Re: [ActiveDir] OT: Script to set DNS on all DCs
>>>
>>>
>>>
>>> It is easy if you do not have multihomed Domain Controller, ad did not
>>> mock with the naming of the NIC (or mocked with in a consistent fashion).
>>>
>>> netsh interface ipv4 set dnsserver static "Local Area Connection"
>>> xx.xx.xx.xx (for 2008)
>>>
>>> netsh interface ip set dnsserver static "Local Area Connection"
>>> xx.xx.xx.xx (for 2003)
>>>
>>> But watch out for various things that change the interface name (driver
>>> changes on VMWare, etc...)
>>>
>>> You can use something like below to dinamically pull the interface name
>>> (as long as there is only one) or loop through all of them.
>>>
>>> Set interfaceFILTERout=Loopback
>>>
>>> for /f "skip=3 tokens=1,4*" %%a in ('netsh interface ipv4 show interfaces
>>> ^|find /i /v "%interfaceFILTERout%"') do (
>>> for /f "tokens=2 delims==" %%d in ('wmic nicconfig where
>>> interfaceindex^=%%a get index /value') do (
>>> call :DNSSET %%a %%b "%%c" %%d
>>> )
>>> )
>>>
>>> :DNSSET
>>>
>>> netsh interface ipv4 set dnsserver static "Local Area Connection"
>>> xx.xx.xx.xx
>>>
>>>
>>> Thank you, Tony.
>>>
>>> *
>>> Tony Gordon*
>>> Windows 2003 & 2000 MCSE, Windows 2003 MCSA, PMP
>>> ITS Infrastructure Engineering
>>> Tel 847.295.5000 x37892 | Fax 847.883.7892
>>> tony dot gordon at hewitt dot tld | www.hewitt.com
>>> P Please consider the environment before printing this e-mail.
>>>
>>> From:
>>>
>>> "Rand Salazar" <rmscheck08@gmail.com>
>>>
>>> To:
>>>
>>> ActiveDir@mail.activedir.org
>>>
>>> Date:
>>>
>>> 10/13/2009 07:22 AM
>>>
>>> Subject:
>>>
>>> [ActiveDir] OT: Script to set DNS on all DCs
>>>
>>> Sent by:
>>>
>>> activedir-owner@mail.activedir.org
>>>
>>>
>>> ------------------------------
>>>
>>>
>>>
>>>
>>> Hey folks..
>>>
>>> I was wondering if anyone could help me devise a script that would
>>> change all the primary DNS settings on my DCs to a specific IP. I am
>>> about to do some DNS work (break out _msdcs, and zones) and need to
>>> point them all to one DC. Problem is, I have 65 DCs, and would surely
>>> hate to hit them up one by one....
>>>
>>> Then of course, the problem becomes changing them back.. ack!
>>>
>>> Anyone face a similar situation?
>>>
>>> -Rand.
>>>
>>>
>>>
>>> ------------------------------
>>>
>>>
>>> The information contained in this e-mail and any accompanying documents
>>> may contain information that is confidential or otherwise protected from
>>> disclosure. If you are not the intended recipient of this message, or if
>>> this message has been addressed to you in error, please immediately alert
>>> the sender by reply e-mail and then delete this message, including any
>>> attachments. Any dissemination, distribution or other use of the contents of
>>> this message by anyone other than the intended recipient is strictly
>>> prohibited. All messages sent to and from this e-mail address may be
>>> monitored as permitted by applicable law and regulations to ensure
>>> compliance with our internal policies and to protect our business. E-mails
>>> are not secure and cannot be guaranteed to be error free as they can be
>>> intercepted, amended, lost or destroyed, or contain viruses. You are deemed
>>> to have accepted these risks if you communicate with us by e-mail.
>>> ------------------------------
>>>
>>> This e-mail message has been scanned for Viruses and cleared by *NetIQ
>>> MailMarshal *
>>> ------------------------------
>>>
>>> ------------------------------
>>> *Please Note: *
>>>
>>> The information contained in this email message and any attached files
>>> may be confidential and subject to privilege. Any opinions expressed in this
>>> message are not necessarily those of the Department of Building and Housing.
>>> All technical opinions are offered on a ‘no-liability’ basis. This message
>>> and any files transmitted with it are confidential and solely for the use of
>>> the intended recipient. If you are not the intended recipient, you are
>>> notified that any use, disclosure or copying of this email is unauthorised.
>>> If you have received this email in error, please notify us immediately by
>>> reply email and delete the original and any attachment(s). Thank you.
>>> ------------------------------
>>>
>>>
>>
>

You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > [ActiveDir] OT: Script to set DNS on all DCs



ActiveForums 3.7
Friends

Friends

VisualClickButoton
Members

Members

MembershipMembership:
Latest New UserLatest:MrPTSai
New TodayNew Today:0
New YesterdayNew Yesterday:0
User CountOverall:5234

People OnlinePeople Online:
VisitorsVisitors:32
MembersMembers:0
TotalTotal:32

Online NowOnline Now:

Ads

Copyright 2009 ActiveDir.org
Terms Of Use