Announcement

Collapse
No announcement yet.

change static IP to DHCP (NT 4.0)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • change static IP to DHCP (NT 4.0)

    Hi all,

    i found this article about mentioned issue:
    http://support.microsoft.com/kb/194407/en-us

    Is it hard to make this kind of script (can it be done by rookie)? Anyone have any suggestions, guidelines, or maybe some script that already exists, and does the same... ?

    thanks in advance

  • #2
    Re: change static IP to DHCP (NT 4.0)

    from
    Code:
    strComputer = "."  '<---- enter "name" of the remote computer
    
    Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
     & strComputer & "\root\cimv2")
    
    Set colNetAdapters = objWMIService.ExecQuery _
        ("Select * from Win32_NetworkAdapterConfiguration " _
            & "where IPEnabled=TRUE",,48)
     
    For Each objNetAdapter In colNetAdapters
       ' http://msdn2.microsoft.com/en-us/library/aa390378.aspx
        errEnable = objNetAdapter.EnableDHCP()
    Next
    Test if the script also takes care of the dns-server list from the nic configuration in windows NT
    (in windows 2000 and newer that list of dnsserver(s) must cleared seperately by using the 'SetDNSServerSearchOrder Method' before you can use it for scope dns options. But, this method is not supported in Windows NT)


    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: change static IP to DHCP (NT 4.0)

      I personally use inputboxes to computernames - if you are going to use the script more than once or so people can't break it...

      Code:
      strComputer = InputBox("Enter Computername:","Title-StaticIPtoDHCP","?")
      This is my signature.

      Comment


      • #4
        Re: change static IP to DHCP (NT 4.0)

        sorry for late response, but apparently i can't use WMI, so these scripts are of no help to me...

        any other suggestions would be greatly appreciated,

        thanks

        Comment


        • #5
          Re: change static IP to DHCP (NT 4.0)

          There are infact 2 problems,
          1st one is my script, it chooses authenticationLevel=Pkt
          But kerberos (oops) is not supported by WinNT, therefore it should be authenticationLevel=Connect.

          2nd one is that apparently WMI was not installed with a standard installation of Windows NT
          You can download the WinNT version of the service here:
          http://www.microsoft.com/downloads/d...7-4C2B1014A31E
          How do I enable Remote WMI on Windows NT 4.0?:
          http://www.spiceworks.com/help/faq_h...dows_nt40.html


          \Rems

          This posting is provided "AS IS" with no warranties, and confers no rights.

          __________________

          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts

          Comment

          Working...
          X