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

Comments

  • 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
Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share