<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PowerShell Scripting with WMI Part 2</title>
	<atom:link href="http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershellpro.com</link>
	<description>Sharing the Experience</description>
	<lastBuildDate>Mon, 06 Sep 2010 23:05:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bill</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-468</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Wed, 07 Apr 2010 20:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-468</guid>
		<description>Tried the below but no success:

$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration &#124; where{$_.IPEnabled -eq “TRUE”}
Foreach($NIC in $NICs) {
$NIC
$IPAddress = ”172.18.16.96&quot;,&quot;172.18.16.196&quot;
$NIC.EnableStatic($IPAddress, “255.255.255.0&quot;)
$NIC.SetGateways(”172.18.16.4&quot;)
$DNSServers = “172.18.1.50&quot;,&quot;172.18.1.52&quot;,&quot;172.18.90.52&quot;,&quot;172.18.90.53&quot;
$NIC.SetDNSServerSearchOrder($DNSServers)
$NIC.SetDynamicDNSRegistration(”TRUE”)
$NIC.SetWINSServer(”172.18.1.52&quot;, “172.18.1.169&quot;)
}</description>
		<content:encoded><![CDATA[<p>Tried the below but no success:</p>
<p>$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq “TRUE”}<br />
Foreach($NIC in $NICs) {<br />
$NIC<br />
$IPAddress = ”172.18.16.96&#8243;,&#8221;172.18.16.196&#8243;<br />
$NIC.EnableStatic($IPAddress, “255.255.255.0&#8243;)<br />
$NIC.SetGateways(”172.18.16.4&#8243;)<br />
$DNSServers = “172.18.1.50&#8243;,&#8221;172.18.1.52&#8243;,&#8221;172.18.90.52&#8243;,&#8221;172.18.90.53&#8243;<br />
$NIC.SetDNSServerSearchOrder($DNSServers)<br />
$NIC.SetDynamicDNSRegistration(”TRUE”)<br />
$NIC.SetWINSServer(”172.18.1.52&#8243;, “172.18.1.169&#8243;)<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-467</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Wed, 07 Apr 2010 19:48:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-467</guid>
		<description>What if you need to have multiple IP addresses bound to the same NIC?</description>
		<content:encoded><![CDATA[<p>What if you need to have multiple IP addresses bound to the same NIC?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mirws</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-443</link>
		<dc:creator>mirws</dc:creator>
		<pubDate>Wed, 17 Feb 2010 01:41:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-443</guid>
		<description>Hi there..
I try a remote reboot script but I got a message like this: 
&quot;Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
At line:2 char:26
+ $colItems = Get-WmiObject &lt;&lt;&lt;&lt;  Win32_OperatingSystem -ComputerName “$strComputer”
    + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
 
You cannot call a method on a null-valued expression.
At line:4 char:13
+ $Item.Reboot &lt;&lt;&lt;&lt; ()
    + CategoryInfo          : InvalidOperation: (Reboot:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull&quot;

Its looks like I dont have a permission,.. although I run a powershell as a administator user. Did I make something wrong to execute this script? any advice are welcome...</description>
		<content:encoded><![CDATA[<p>Hi there..<br />
I try a remote reboot script but I got a message like this:<br />
&#8220;Get-WmiObject : Access is denied. (Exception from HRESULT: 0&#215;80070005 (E_ACCESSDENIED))<br />
At line:2 char:26<br />
+ $colItems = Get-WmiObject &lt;&lt;&lt;&lt;  Win32_OperatingSystem -ComputerName “$strComputer”<br />
    + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException<br />
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand</p>
<p>You cannot call a method on a null-valued expression.<br />
At line:4 char:13<br />
+ $Item.Reboot &lt;&lt;&lt;&lt; ()<br />
    + CategoryInfo          : InvalidOperation: (Reboot:String) [], RuntimeException<br />
    + FullyQualifiedErrorId : InvokeMethodOnNull&#8221;</p>
<p>Its looks like I dont have a permission,.. although I run a powershell as a administator user. Did I make something wrong to execute this script? any advice are welcome&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marty</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-409</link>
		<dc:creator>Marty</dc:creator>
		<pubDate>Fri, 02 Oct 2009 02:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-409</guid>
		<description>Also can find if the NIC is in promiscuous mode with code snip:
http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/</description>
		<content:encoded><![CDATA[<p>Also can find if the NIC is in promiscuous mode with code snip:<br />
<a href="http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/" rel="nofollow">http://praetorianprefect.com/archives/2009/09/whos-being-promiscuous-in-your-active-directory/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magnus Kristoffersen</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-293</link>
		<dc:creator>Magnus Kristoffersen</dc:creator>
		<pubDate>Tue, 10 Mar 2009 10:49:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-293</guid>
		<description>I have a script that is almost the same as your. (I&#039;m searching for a spesific nic) So I was wondering if you had the same problem as me. After defining a gateway using SetGateways() the gateway i specify gets added as a default gateway that stays saved even after I turn on DHCP again. I cant figure out a way to remove it other than doing it manually.

Cheers</description>
		<content:encoded><![CDATA[<p>I have a script that is almost the same as your. (I&#8217;m searching for a spesific nic) So I was wondering if you had the same problem as me. After defining a gateway using SetGateways() the gateway i specify gets added as a default gateway that stays saved even after I turn on DHCP again. I cant figure out a way to remove it other than doing it manually.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Palle Grassmé</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-267</link>
		<dc:creator>Palle Grassmé</dc:creator>
		<pubDate>Wed, 10 Dec 2008 12:54:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-267</guid>
		<description>Is it possible to prepend the primary and secondary WINS server addresses to the existing WINS settings?</description>
		<content:encoded><![CDATA[<p>Is it possible to prepend the primary and secondary WINS server addresses to the existing WINS settings?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Hamrick</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-141</link>
		<dc:creator>Jesse Hamrick</dc:creator>
		<pubDate>Fri, 27 Jun 2008 14:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-141</guid>
		<description>The example provided assumes that only one nic in the system is IP enabled. Which is the case for a majority of workstations within most networking environments. If you have a special case where you have workstation that have multiple nics that require separate IP address, then you would set up a filter to connect to the nic of your choice. If you do a get-member on the wmi object there are many properties you can choose to filter. Since we are looking for a unique property I tend to use the MAC address of the nic. I want to change and customize the filter as follows:
$NICs = Get-WmiObject Win32_NetworkAdapterConfiguration `
&#124; Where {$_.MACAddress -eq &quot;3E:6D:10:34:22:3D&quot;}

This filter assures me that I am connecting to the NIC I wish to make changes too. That way if I have two nics in the system, I&#039;m only making changes to the one I choose...</description>
		<content:encoded><![CDATA[<p>The example provided assumes that only one nic in the system is IP enabled. Which is the case for a majority of workstations within most networking environments. If you have a special case where you have workstation that have multiple nics that require separate IP address, then you would set up a filter to connect to the nic of your choice. If you do a get-member on the wmi object there are many properties you can choose to filter. Since we are looking for a unique property I tend to use the MAC address of the nic. I want to change and customize the filter as follows:<br />
$NICs = Get-WmiObject Win32_NetworkAdapterConfiguration `<br />
| Where {$_.MACAddress -eq &#8220;3E:6D:10:34:22:3D&#8221;}</p>
<p>This filter assures me that I am connecting to the NIC I wish to make changes too. That way if I have two nics in the system, I&#8217;m only making changes to the one I choose&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian BARDOU</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-140</link>
		<dc:creator>Christian BARDOU</dc:creator>
		<pubDate>Fri, 27 Jun 2008 13:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-140</guid>
		<description>Hi Jesse ?,

In the &quot;Foreach&quot; loop  of the example 2, i don&#039;t understand how the IP address can be different for each instance of $NICs collection ?

Regards</description>
		<content:encoded><![CDATA[<p>Hi Jesse ?,</p>
<p>In the &#8220;Foreach&#8221; loop  of the example 2, i don&#8217;t understand how the IP address can be different for each instance of $NICs collection ?</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Hamrick</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-100</link>
		<dc:creator>Jesse Hamrick</dc:creator>
		<pubDate>Wed, 30 Apr 2008 15:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-100</guid>
		<description>Do you mean something like this:

$ipaddress = &quot;10.0.0.1&quot;
$subMask = &quot;255.0.0.0&quot;
$NIC.EnableStatic($ipaddress, $subMask)

-or-
$ipaddress = Read-Host &quot;Enter the IP Address&quot;
$subMask = Read-Host &quot;Enter Subnet Mask&quot;
$GW = Read-Host &quot;Enter Default Gateway&quot;

Etc...</description>
		<content:encoded><![CDATA[<p>Do you mean something like this:</p>
<p>$ipaddress = &#8220;10.0.0.1&#8243;<br />
$subMask = &#8220;255.0.0.0&#8243;<br />
$NIC.EnableStatic($ipaddress, $subMask)</p>
<p>-or-<br />
$ipaddress = Read-Host &#8220;Enter the IP Address&#8221;<br />
$subMask = Read-Host &#8220;Enter Subnet Mask&#8221;<br />
$GW = Read-Host &#8220;Enter Default Gateway&#8221;</p>
<p>Etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Duguid</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/comment-page-1/#comment-99</link>
		<dc:creator>Matt Duguid</dc:creator>
		<pubDate>Wed, 30 Apr 2008 05:10:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part2/#comment-99</guid>
		<description>I am interested to see how to pass the IP ADDRESS and SUBNET in as powershell variables.</description>
		<content:encoded><![CDATA[<p>I am interested to see how to pass the IP ADDRESS and SUBNET in as powershell variables.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
