<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JS: Как изменить адреса DNS на сетевом адаптере.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13338&amp;type=atom" />
	<updated>2018-05-27T16:43:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13338</id>
		<entry>
			<title type="html"><![CDATA[Re: JS: Как изменить адреса DNS на сетевом адаптере.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125646#p125646" />
			<content type="html"><![CDATA[<p><strong>im2002</strong>, подойдет вариант на VBS?<br /></p><div class="codebox"><pre><code>strComputer = &quot;.&quot;
Set objRegistry = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; &amp;strComputer &amp; &quot;\root\default:StdRegProv&quot;)
Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colNetAdapters = objWMIService.ExecQuery (&quot;Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE&quot;)
Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
strGatewayMetric = Array(1)
strDNS = Array(&quot;8.8.8.8&quot;, &quot;8.8.4.4&quot;) 
For Each objNetAdapter in colNetAdapters
errDNS = objNetAdapter.SetDnsServerSearchOrder(strDNS)
Next
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[madjahed]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29005</uri>
			</author>
			<updated>2018-05-27T16:43:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125646#p125646</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JS: Как изменить адреса DNS на сетевом адаптере.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=122731#p122731" />
			<content type="html"><![CDATA[<p>Есть же программа NetSetMan для этой цели.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2018-01-02T19:48:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=122731#p122731</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JS: Как изменить адреса DNS на сетевом адаптере.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=122607#p122607" />
			<content type="html"><![CDATA[<p>sorry... небольшое дополнение, на некоторых адаптерах всё проходит ОК, даже, если не был указан вторичный DNS... пока разбираюсь.</p>]]></content>
			<author>
				<name><![CDATA[im2002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28063</uri>
			</author>
			<updated>2017-12-29T06:00:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=122607#p122607</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[JS: Как изменить адреса DNS на сетевом адаптере.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=122606#p122606" />
			<content type="html"><![CDATA[<p>Вопрос такой: как изменить ОБА адреса DNS на адаптере? <br />использовал такой код:<br /></p><div class="codebox"><pre><code>en.item().SetDNSServerSearchOrder([&quot;192.168.0.8&quot;, &quot;192.168.0.2&quot;]);</code></pre></div><p>где en.item() - элемент коллекции класса Win32_NetworkAdapterConfiguration<br />К сожалению такой код может изменить значения DNS, если только на адаптере были прописаны оба DNS.<br />Если был прописан один, то таким образом меняется только первичный DNS-сервер, поле вторичного сервера так и остаётся пустым <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br />Настройки сетевых адаптеров статические, DHCP не поднят.</p>]]></content>
			<author>
				<name><![CDATA[im2002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28063</uri>
			</author>
			<updated>2017-12-29T05:49:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=122606#p122606</id>
		</entry>
</feed>
