+ Post New Thread
Results 1 to 7 of 7
Scripts Thread, SCRIPT TO ADD A SECONDARY DNS in Coding and Web Development; HI ALL, I RECENTLY STARTED WORK AT A SCHOOL I AM STILL TRYING TO LEARN THE ROPES. THE PREVIOUS NETWORK ...
  1. #1

    Join Date
    Aug 2009
    Location
    Australia
    Posts
    24
    Thank Post
    11
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    SCRIPT TO ADD A SECONDARY DNS

    HI ALL,
    I RECENTLY STARTED WORK AT A SCHOOL I AM STILL TRYING TO LEARN THE ROPES.
    THE PREVIOUS NETWORK ADMIN USED STATIC IP ADDRESS FOR EVERYTHING.
    i HAVE RECENTLY INSTALLED A DHCP AND IT IS WORKING
    I ALSO CONFIGURED A SECONDARY DNS WORKING AS WELL.
    ALL NEW CONECTIONS WORK.
    I NEED TO CHANGE THE OTHER 500 COMPUTERS.
    CAN SOMEONE HELP ME CHANGE THE SECONDARY DNS ON ALL MACHINES OR SOMEONE HELP ME WITH A SCRIPT THAT WILL CHANGE SETTING TO USE DHCP

  2. #2
    cromertech's Avatar
    Join Date
    Dec 2007
    Location
    Cromer by the coast
    Posts
    731
    Thank Post
    177
    Thanked 109 Times in 97 Posts
    Rep Power
    53
    If your clients can run a startup script from group policy then
    Code:
    netsh interface ip set address "Local Area Connection" dhcp
    will do the job as long as they're not wireless. I think if they are wireless you need to change 'local area connection' to 'Wireless Network Connection'

  3. #3
    sister_annex's Avatar
    Join Date
    Jan 2009
    Location
    Wolverhampton
    Posts
    572
    Thank Post
    98
    Thanked 126 Times in 111 Posts
    Rep Power
    46
    From the spiceworks website: Simple Script to Enable DHCP on Network adapters - Script Center - Spiceworks Community

    The script is a VBS Script

    Code:
    ' Enable DHCP
    
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    Set colNetAdapters = objWMIService.ExecQuery _
        ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
     
    For Each objNetAdapter In colNetAdapters
        errEnable = objNetAdapter.EnableDHCP()
    Next

  4. #4
    somabc's Avatar
    Join Date
    Oct 2007
    Location
    London
    Posts
    2,337
    Thank Post
    83
    Thanked 388 Times in 258 Posts
    Rep Power
    111
    Welcome to edugeek, there are several approaches using netsh or vbscript, Cromertech's solution is probably the easiest for you to implement.

    VBScript: Reset DNS to DHCP Assigned

    PS please do not write all in CAPS it is very hard to read!
    Last edited by somabc; 7th March 2011 at 02:09 PM.

  5. #5

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,855
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    181
    Quote Originally Posted by djgreek View Post
    HI ALL,
    I RECENTLY STARTED WORK AT A SCHOOL I AM STILL TRYING TO LEARN THE ROPES. ...
    lesson #1: your caps key is between Shift and Tab.

  6. #6
    sister_annex's Avatar
    Join Date
    Jan 2009
    Location
    Wolverhampton
    Posts
    572
    Thank Post
    98
    Thanked 126 Times in 111 Posts
    Rep Power
    46
    Quote Originally Posted by powdarrmonkey View Post
    lesson #1: your caps key is between Shift and Tab.
    Sorry, I know i shouldn't but... LOL!!!

  7. #7

    Join Date
    Aug 2009
    Location
    Australia
    Posts
    24
    Thank Post
    11
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    ok so i used the netsh interface ip set address "Local Area Connection" dhcp
    But there are so many different connection names
    can i somehow join them

SHARE:
+ Post New Thread

Similar Threads

  1. Script to add fields to a csv file
    By IrritableTech in forum Scripts
    Replies: 13
    Last Post: 22nd October 2010, 12:11 PM
  2. Adding a dns entry to a secondary domain?
    By reggiep in forum Windows
    Replies: 2
    Last Post: 6th August 2008, 09:27 AM
  3. Script to add computers to AD like RIS
    By box_l in forum Scripts
    Replies: 2
    Last Post: 4th June 2008, 08:34 PM
  4. Add cachepilot to w2k3 DNS
    By SimpleSi in forum *nix
    Replies: 3
    Last Post: 18th January 2008, 12:14 PM
  5. Add printer script not workling
    By mark in forum Windows
    Replies: 6
    Last Post: 15th September 2005, 10:07 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •