Q: Script to append the exisiting DNS suffix search order on W2K clients

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All

I am migrating Windows 2000 Clients to a new DNS domain and want to write a
script that will append the current DNS Suffix search order with an
additional suffix

I have the following script that will OVERWRITE the current suffix search
order but I need to preserve what's there and add to it (append it)

SET WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite
"HKLM\System\CurrentControlSet\Services\TCPIP\Parameters\SearchList", "new
domain.co.uk,olddomain.co.uk,resourcedomain.co.uk", "REG_SZ"

Can you help?

Thanks

Andy
 
Hi All

I am migrating Windows 2000 Clients to a new DNS domain and
want to write a
script that will append the current DNS Suffix search order
with an
additional suffix

I have the following script that will OVERWRITE the current
suffix search
order but I need to preserve what's there and add to it
(append it)

SET WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite
"HKLMSystemCurrentControlSetServicesTCPIPParametersSearc
hList",
"new
domain.co.uk,olddomain.co.uk,resourcedomain.co.uk", "REG_SZ"

Can you help?

Thanks

Andy

you could create your own ADM file, add it to a GPO, link the GPO to
the OU with the Windows 2000 clients.

see below:
##################
CLASS MACHINE
CATEGORY "System"
CATEGORY "Custom Settings DNS"
KEYNAME "SystemCurrentControlSetServicesTCPIPParameters"
POLICY "DNS Suffix Search List"
EXPLAIN "EXPLANATION: Determines the DNS suffixes to attach to an
unqualified single-label name before submission of a DNS query for
that
name.nnAn unqualified single-label name contains no dots, such as
"example".
This is different from a fully qualified domain name, such as
"example.microsoft.com.".nnWith this setting enabled, when a user
submits a
query for a single-label name, such as "example", a local DNS client
attaches a
suffix, such as "microsoft.com", resulting in the query
"example.microsoft.com", before sending the query to a DNS
server.nnIf you
enable this setting, you can specify the DNS suffixes to attach before

submission of a query for an unqualified single-label name. The values
of the
DNS suffixes in this setting may be set using comma-separated strings,
such as
"microsoft.com,serverua.microsoft.com,office.microsoft.com". One DNS
suffix is
attached for each submission of a query. If a query is unsuccessful, a
new DNS
suffix is added in place of the failed suffix, and this new query is
submitted.
The values are used in the order they appear in the string, starting
with the
leftmost value and preceding to the right.nnIf you enable this
setting, you
must specify at least one suffix.nnIf you disable this setting, the
primary
DNS suffix and network connection-specific DNS suffixes are appended
to the
unqualified queries.nnIf this setting is not configured, it is not
applied to
any computers, and computers use their local configuration."
PART "DNS Suffixes:" EDITTEXT REQUIRED
VALUENAME "SearchList"
END PART
END POLICY
END CATEGORY
END CATEGORY
 
eh, moving DNS domain to prepare to upgrade to 2003 & AD. We're currently
goodold NT4!

So I found this script:

::
@echo off
setlocal
set "key=HKLM\System\CurrentControlSet\Services\TCPIP\Parameters"
set val=SearchList
set ApP="windows.comapny.co.uk,"
for /f "tokens=1-2,*" %%A in (
'Reg query "%key%" /v %val%^|findstr /I "%val% REG_"') do (
REG ADD "%key%" /v %val% /t %%B /d %ApP%%%C /f
)

which works.

Thanks for the reply

A.
 
Back
Top