Hi team,
Advance thank
We have 200+ servers are we need servers DNS IP and please advise for this automation task or flexlet is there ??
Hi team,
Advance thank
We have 200+ servers are we need servers DNS IP and please advise for this automation task or flexlet is there ??
It isn’t clear whether you are trying to obtain the current DNS server setting(s) or set new ones.
To read the current settings,
https://developer.bigfix.com/relevance/reference/network-adapter.html
If you need to change the current settings, how would you do this off the command line? Once we know that we can help you convert that to ActionScript.
Required all servers dns ip change change is there
Manually it will take more time any fexlet or task is there pl ?
This will require a custom fixlet.
So, how would you do it from the command line? I’m not requesting that you do it manually, but if you can tell us the command we can help you create a custom fixlet.
I’m not suly about , I’m have only option change dns goto network adaptor change dns ips
You’d use netsh.exe to change the DNS servers. I’ve done this in fixlets before but it will take a while to dig up the reference again…hopefully the hint to look at netsh.exe options can be helpful.
The approach we have used to update DNS servers has been when we know the undesired DNS server and what we need to change it to. Relevance for the detection used the inspectors indicated by @trn
exists (adapters of networks) whose ((exists addresses whose (it as string contains "1.2.3.4" OR it as string contains "2.3.4.5") of dns servers of it) AND (up of it) AND (not dhcp enabled of it) AND (description of it as string as lowercase does not contain "something"))
The description was specific to our use case to exclude a specific virtual adaptor and probablay not required for your use case.
The action was to parse the adaptor names that had the wrong DNS IP and use that in a PowerShell script to chagne each adaptor.
// Parameterize adapter names
parameter "IDs" = "{concatenation "," of ("'" & it & "'") of (names of (adapters of networks) whose ((exists addresses whose (it as string contains "1.2.3.4" OR it as string contains "2.3.4.5") of dns servers of it) AND (up of it) AND (not dhcp enabled of it) AND (description of it as string as lowercase does not contain "something")))}"
// Cleanup
delete __createfile
// Write script
createfile until EOL
$IDs = @({parameter "IDs"})
foreach($ID in $IDs)
{
$DNS = get-wmiobject -class win32_networkadapterconfiguration -filter "SettingID='$ID'"
$DNS.SetDNSServerSearchOrder(@("6.7.8.9","7.8.9.1"))
}
EOL
//Execute script
copy __createfile {value of variable "temp" of environment & "\dns.ps1"}
waithidden powershell -executionpolicy bypass {value of variable "temp" of environment & "\dns.ps1"}
// Cleanup
delete {value of variable "temp" of environment & "\dns.ps1"}
// Force register DNS (run twice at advice from directory team)
waithidden cmd.exe /c ipconfig /registerdns
waithidden cmd.exe /c ipconfig /registerdns