Answered by:
Configuring Virtual Machine's Network Adapter from the Virtual Machine using PowerShell

Question
-
I'm working on some VM automations which require VMNetworkAdapters to be configured using Windows PowerShell. Specifically, the VMs have multiple Network Adapters and few of them are either to be renamed/disabled.
From the host, this can be easily achieved using Rename-VMNetworkAdapter and Disconnect-VMNetworkAdapter cmdlets. Also, the VMNetworkAdapters are by default named "Network Adapter". But, this name is not visible from the VM. Get-NetAdapter cmdlet in the VM returns a network adapter named "Ethernet".
Is there a way to view and configure VMNetworkAdapters from the Virtual Machines?
Answers
-
Hi,
I haven't tried this myself, so I'm not sure if this works or not, but you can try opening an interactive session on the host machine with Enter-PSSession.
http://technet.microsoft.com/en-us/library/hh849707.aspx
Don't retire TechNet! - (Don't give up yet - 12,700+ strong and growing)
- Edited by Mike LaughlinModerator Tuesday, March 11, 2014 12:42 PM
- Marked as answer by Yan Li_Moderator Wednesday, March 26, 2014 2:03 AM
-
Hi,
On the host, run poweshell as administrator, then with get-vmnetworkadapter command we should be able to get virtual machines network adapter settings. And set-vmnetworkadapter command can help to configure adapter settings.
Please refer to the below articles for more details:
Set-VMNetworkAdapter
http://technet.microsoft.com/en-us/library/hh848457.aspx
Regards,
Yan Li
Regards, Yan Li
- Marked as answer by Yan Li_Moderator Wednesday, March 26, 2014 2:03 AM
All replies
-
Hi,
I haven't tried this myself, so I'm not sure if this works or not, but you can try opening an interactive session on the host machine with Enter-PSSession.
http://technet.microsoft.com/en-us/library/hh849707.aspx
Don't retire TechNet! - (Don't give up yet - 12,700+ strong and growing)
- Edited by Mike LaughlinModerator Tuesday, March 11, 2014 12:42 PM
- Marked as answer by Yan Li_Moderator Wednesday, March 26, 2014 2:03 AM
-
Hi,
On the host, run poweshell as administrator, then with get-vmnetworkadapter command we should be able to get virtual machines network adapter settings. And set-vmnetworkadapter command can help to configure adapter settings.
Please refer to the below articles for more details:
Set-VMNetworkAdapter
http://technet.microsoft.com/en-us/library/hh848457.aspx
Regards,
Yan Li
Regards, Yan Li
- Marked as answer by Yan Li_Moderator Wednesday, March 26, 2014 2:03 AM
-
Hi,
Just checking in to see if the suggestion was helpful. Please let us know if you would like further assistance.
If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.
Regards, Yan Li