0

I would like to write up a script to assign static IP based on mac addresses, as I am having trouble with "USB to ethernet" adapters lose it's IP settings and assign to different interface Names.

I am running on windows 10 environment and have found a wmi script online that I think might work.

Code I am using:

wmic nicconfig where macaddress="0F:98:90:D6:42:92" call EnableStatic ("192.168.1.1"), ("255.255.255.0")

Error output: "Invalid format. Hint: = [, ]."

Thanks

1 Answer 1

1

Something like this

$netAdapter = Get-WmiObject Win32_NetworkAdapterConfiguration | where {$_.MACAddress -eq '0F:98:90:D6:42:92'}

$netAdapter.EnableStatic("192.168.1.1", "255.255.255.0")

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.