Greetings!
I have a simple task ahead of me, to roll a script over a block of freshly migrated VMs and change the VLAN they sit on.
I figured this would be as easy as grabbing the network adapter and changing the NetworkName field. However, during some initial test output of Get-NetworkAdapter, I can't understand the output.
The VM itself, in vSphere shows as follows:
When I grab the VM and it's adapter via $vm | Get-NetworkAdapter, I get the following output:
Name Type NetworkName MacAddress WakeOnLan
Enabled
---- ---- ----------- ---------- ---------
Network adapter 1 e1000 VM Networ... 00:50:56:a9:03:93 True
Network adapter 1 Flexible VM Networ... 00:50:56:a9:04:26 True
Which was weird, then I filtered that a bit down to this:
Name NetworkName
---- -----------
Network adapter 1 VM Network Vlan62
Network adapter 1 VM Network Vlan20
No idea how to interpret this, or why it even displays this way.. it shows through various other filters that the Vlan20 adapter is disconnected.. but again when I'm looking at the config of the VM in vSphere there's just one NIC and it's on Vlan63.
Thanks in advance for any assistance!!
I would guess you have more than object in $vm, can you check ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I would guess you have more than object in $vm, can you check ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Like Luc said, is there more than one VM in $vm? Did you use wildcards while defining $vm?
Wow... It sucks to admit it but it looks like I typed *tst02* yesterday, instead of *test02* when grabbing my test box.. that explains it all ! Thanks for the sanity check guys -__-.