/build/static/layout/Breadcrumb_cap_w.png

Join Domain.vbs - disable registering machine in DNS?

Quest assist with the join_domain.vbs script so machine can join the domain when deploying a system image from K2000 .  Is there somewhere in this same script to tweak or add to disable a machine from registering itself in DNS?

Such as:

Netsh

                It can be scripted using Netsh

                                IPv4:

                                netsh interface ipv4 set dnsservers name="Local Network Area" source=dhcp register=none


Not sure if this is the same location in the script below as this line:

objShell.Run "netsh int ip set dns ""local area connection"" static " & _

                              

Here is the original vbs script contents:

Const JOIN_DOMAIN             = 1

Const ACCT_CREATE             = 2

Const ACCT_DELETE             = 4

Const WIN9X_UPGRADE           = 16

Const DOMAIN_JOIN_IF_JOINED   = 32

Const JOIN_UNSECURE           = 64

Const MACHINE_PASSWORD_PASSED = 128

Const DEFERRED_SPN_SET        = 256

Const INSTALL_INVOCATION      = 262144


If WScript.Arguments.Count < 3 or WScript.Arguments.Count > 4 Then

' Duff arguments so return non zero so the task is marked as failed.

WScript.Quit(1)

Else


strDomain   = WScript.Arguments.Item(0)

strUser = WScript.Arguments.Item(1)

strPassword = WScript.Arguments.Item(2)


'set DNS IP address

If WScript.Arguments.Count = 4 Then

    strDNSIP = WScript.Arguments.Item(3)

    Set objShell = CreateObject("WScript.shell")

    objShell.Run "netsh int ip set dns ""local area connection"" static " & _

                strDNSIP &" primary", 0 , 0

  End If

End If


Set objNetwork = CreateObject("WScript.Network")

strComputer = objNetwork.ComputerName



Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _

                             strComputer & _

                             "\root\cimv2:Win32_ComputerSystem.Name='" _

                             & strComputer & "'")


ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _

                                                strPassword, _

                                                strDomain & "\" & strUser, _

                                                NULL, _

                                                JOIN_DOMAIN+ACCT_CREATE)


1 Comment   [ + ] Show comment
  • Via Scripting it sounds like a good Poweshell Script might be needed to avoid this.

    Manual way is described here:
    https://support.microsoft.com/en-us/help/2023004/steps-to-avoid-registering-unwanted-nic-s-in-dns-on-a-mulithomed-domai

    and here:
    http://geekswithblogs.net/technetbytes/archive/2011/10/09/147233.aspx - Channeler 6 years ago

Answers (0)

Be the first to answer this question

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ