<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Use PowerShell to Configure Static IP and DNS Settings</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx</link><description>Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to set the static IP and DNS addresses on a server.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Use PowerShell to Configure Static IP and DNS Settings</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx#3532783</link><pubDate>Thu, 15 Nov 2012 18:09:14 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3532783</guid><dc:creator>graben</dc:creator><description>&lt;p&gt;Is there any way to set the IP that is assigned by dhcp to a static IP.&lt;/p&gt;
&lt;p&gt;If dhcp assigns &lt;/p&gt;
&lt;p&gt;192.168.1.10&lt;/p&gt;
&lt;p&gt;255.255.255.0&lt;/p&gt;
&lt;p&gt;192.168.1.1&lt;/p&gt;
&lt;p&gt;I would like a script that can take that and set it statically&lt;/p&gt;
&lt;p&gt;is that even possible?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3532783" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Configure Static IP and DNS Settings</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx#3517929</link><pubDate>Tue, 04 Sep 2012 15:17:59 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3517929</guid><dc:creator>rajdude</dc:creator><description>&lt;p&gt;Does not work for me. I get this error:&lt;/p&gt;
&lt;p&gt;PS C:\Windows\system32&amp;gt; $wmi = Get-WmiObject win32_networkadapterconfiguration -filter &amp;quot;ipenabled = &amp;#39;true&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;$wmi.EnableStatic(&amp;quot;10.0.0.15&amp;quot;, &amp;quot;255.255.255.0&amp;quot;)&lt;/p&gt;
&lt;p&gt;$wmi.SetGateways(&amp;quot;10.0.0.1&amp;quot;, 1)&lt;/p&gt;
&lt;p&gt;$wmi.SetDNSServerSearchOrder(&amp;quot;10.0.0.100&amp;quot;)&lt;/p&gt;
&lt;p&gt;Method invocation failed because [System.Object[]] doesn&amp;#39;t contain a method named &amp;#39;EnableStatic&amp;#39;.&lt;/p&gt;
&lt;p&gt;At line:2 char:18&lt;/p&gt;
&lt;p&gt;+ $wmi.EnableStatic &amp;lt;&amp;lt;&amp;lt;&amp;lt; (&amp;quot;10.0.0.15&amp;quot;, &amp;quot;255.255.255.0&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: InvalidOperation: (EnableStatic:String) [], RuntimeException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : MethodNotFound&lt;/p&gt;
&lt;p&gt;Method invocation failed because [System.Object[]] doesn&amp;#39;t contain a method named &amp;#39;SetGateways&amp;#39;.&lt;/p&gt;
&lt;p&gt;At line:3 char:17&lt;/p&gt;
&lt;p&gt;+ $wmi.SetGateways &amp;lt;&amp;lt;&amp;lt;&amp;lt; (&amp;quot;10.0.0.1&amp;quot;, 1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: InvalidOperation: (SetGateways:String) [], RuntimeException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : MethodNotFound&lt;/p&gt;
&lt;p&gt;Method invocation failed because [System.Object[]] doesn&amp;#39;t contain a method named &amp;#39;SetDNSServerSearchOrder&amp;#39;.&lt;/p&gt;
&lt;p&gt;At line:4 char:29&lt;/p&gt;
&lt;p&gt;+ $wmi.SetDNSServerSearchOrder &amp;lt;&amp;lt;&amp;lt;&amp;lt; (&amp;quot;10.0.0.100&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: InvalidOperation: (SetDNSServerSearchOrder:String) [], RuntimeException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : MethodNotFound&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3517929" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Configure Static IP and DNS Settings</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx#3483871</link><pubDate>Wed, 29 Feb 2012 17:42:43 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3483871</guid><dc:creator>flaphead</dc:creator><description>&lt;p&gt;Excellent script .. question. &amp;nbsp;with how do I add WINS Servers? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have 4 i can add in the GUI and I want to add using Powershell&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3483871" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Configure Static IP and DNS Settings</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx#3483646</link><pubDate>Tue, 28 Feb 2012 22:22:42 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3483646</guid><dc:creator>Victor Nichols</dc:creator><description>&lt;p&gt;Excellent info, thank you for sharing. I could see this coming in very useful in those tight spots we get ourselves into on occasion.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3483646" width="1" height="1"&gt;</description></item><item><title>re: Use PowerShell to Configure Static IP and DNS Settings</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx#3483519</link><pubDate>Tue, 28 Feb 2012 08:23:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3483519</guid><dc:creator>K_Schulte</dc:creator><description>&lt;p&gt;Hi Ed,&lt;/p&gt;
&lt;p&gt;a very interesting post!&lt;/p&gt;
&lt;p&gt;The WMI class win32_networkadapterconfiguration is definitely an interesting object!&lt;/p&gt;
&lt;p&gt;Perhaps I should do more research on the available WMI classes to see what they offer ...&lt;/p&gt;
&lt;p&gt;But it really is not alway obvious, how to find the right class that does the job.&lt;/p&gt;
&lt;p&gt;Perhaps we should have a regular WMI day on the blog to get some more valuable ideas!&lt;/p&gt;
&lt;p&gt;Klaus (Schulte)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3483519" width="1" height="1"&gt;</description></item></channel></rss>