Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $description = "Network Name"
- $staticIp = ""
- $subnetMask = ""
- $gateway = ""
- $adapter = Get-CimInstance Win32_NetworkAdapterConfiguration | Where-Object { $_.Description -match $description}
- $adapter | Invoke-CimMethod -Name EnableStatic -Arguments @{ IPAddress = $staticIp; SubnetMask = $subnetMask }
- $adapter | Invoke-CimMethod -Name SetGateways -Arguments @{ DefaultIPGateway = $gateway; GatewayCostMetric = [UInt16] 1 }
Add Comment
Please, Sign In to add comment