$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration `
| where{$_.IPEnabled -eq "TRUE"}
Foreach($NIC in $NICs) {
$NIC.EnableStatic("......
the docu states out the following syntax:
uint32 EnableStatic(
[in] string IPAddress[],
[in] string SubnetMask[]
);
Both paramters are arrays. so you should first get the ipaddress array and
store it in a variable and then define a subnet mask array and both pass to
the EnableStatic method. I think doing this by using WMI this could be the
right way.
It could be necessary you have to reboot the processed computer.
Reinhard
"guv" wrote:
> .
>
For example:
$NIC = Get-WMIObject Win32_NetworkAdapterConfiguration -Filter
"IPEnabled='$True'"
$NIC.EnableStatic($NIC.IPAddress, @("255.255.242.0"))
Where 255.255.242.0 is the subnet mask. You may also consider pulling
the subnet mask array and only modifying the element you need (should
you have more than one IP address on the interface).
Chris