myITforum and Windows IT Pro Forums

 how to locate and update DNS server search order using SCCM Configmgr

Author Message
soujanyanaganuri

  • Total Posts : 3
  • Scores: 0
  • Reward points : 780
  • Joined: 8/8/2017
  • Status: offline
how to locate and update DNS server search order using SCCM Configmgr Tuesday, August 08, 2017 6:37 AM (permalink)
0
In case you are the usage of SCCM Configmgr for your surroundings, you may accomplish lot manual /administrative tasks the usage of Configmgr the use of deployment/compliance approach.
recently i was running on task to update the DNS records (primary DNS server IP ) for lot of servers as servers use static IP and is required to change it on all where wanted.
As there has been trade in network phase for DNS server ,the IP of the DNS server changed from magnificence B to elegance A.
How do I update the antique DNS server record with the new one on all the servers ? earlier than you operate any approach (scripting or Configure) ,you need to know the list of servers which might be using the antique DNS report and validate and then carry out the exchange .
Given that our infra is the use of Configure to manage workstations and servers ,i can use configure to tug document that the usage of antique DNS server report , create a collection for those servers ,install a script to replace with DNS server file ,display the report if the change is effectively carried out or no longer .
earlier than you generate record, you want to find out which sq. views keep data about DNS server info. network adaptor records is saved in v_GS_NETWORK_ADAPTER_CONFIGUR view.
The data that we are searching out is , DNSServerSearchOrder0 which is not enabled with the aid of default within the hardware inventory magnificence.
You want to enable it by way of going to patron settings-> hardware stock –>set lessons ,seek with network ,you will see network adaptor configuration ,pick out DNS server seek order .
after you enable this ,clients which are deployed with this consumer agent settings will down load the rules and ship the updated inventory during the next scheduled stock cycle.
After that is achieved, you are proper to generate report to look the servers which might be the usage of old DNS document.
here is sq. question to check for DNS Server seek order:
choose sys.name0,os.Caption0,DNSServerSearchOrder0 from v_R_System sys
join v_GS_NETWORK_ADAPTER_CONFIGUR NAC on NAc.ResourceID=sys.ResourceID
join v_GS_OPERATING_SYSTEM os on os.ResourceID=sys.ResourceID
wherein OS.Caption0 like '%server%'
and nac.IPEnabled0='1'
and nac.DNSServerSearchOrder0 like '%vintage DNS SERVER IP%'
From the above question ,you may get servers with their primary DNS and secondary DNS server records .Create a new collection ,add those machines to the gathering.
Now we have list of servers to replace with new DNS server report however we do no longer have bundle to set up to the gathering.
To replace the DNS server statistics ,you may either use powershell or VBscript .in case you are going for walks any server 2003 ,PowerShell isn't always correct alternative for you ,so you may need to use vbscript.
i'm posting each VBscript and PowerShell on your feasibility.
In my case, I need to replace number one DNS record (new IP) and maintain secondary DNS server file as it's far without any exchange.
VBscript:
on blunders resume subsequent
strComputer = "."
Const FullDNSRegistrationEnabled = true
Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
Set colNetCards = objWMIService.ExecQuery ("pick out * From Win32_NetworkAdapterConfiguration wherein IPEnabled = proper")
FOR each objNetCard in colNetCards
arrDNSServers = Array("DNS server IP1","DNS Server IP2")
errEnable = objNetCard.SetDNSServerSearchOrder(arrDNSServers)
objNetCard.SetDynamicDNSRegistration FullDNSRegistrationEnabled
subsequent
when you have number one and secondary DNS ,update the IP cope with consequently inside the above script.
Powershell:
$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration | in which-item {$_.IPEnabled -eq "genuine"}
Foreach($NIC in $NICs) {
$DNSServers = “DNS server IP1"," DNS server IP2”
$NIC.SetDNSServerSearchOrder($DNSServers)
$NIC.SetDynamicDNSRegistration(“real”)
}
whilst you set up the powershell script ,cognizance on the command line you use .when you have enabled the execution of powershell to pass in consumer agent settings ,you can simply use the command line as scriptname.ps1 and set up it else you may should use command line to bypass the execution of powershell script.
PowerShell.exe -ExecutionPolicy bypass -report "scriptname.ps1"
Create a package using above scripts and installation to the gathering ,monitor the outcomes.
For consequences , look forward to the subsequent hardware inventory cycle and fix the difficulty wherein it didn’t undergo.
 
#1
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2017 ASPPlayground.NET Forum Version 3.9