I set the property ElementName and save it using "Put", as shown below. But the network adapter shown in the Windows network connections does not get updated (attached image). Any idea on how to get it updated?
Thanks!
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Windows\system32> Get-WmiObject -Namespace root\virtualization msvm_virtualswitch -filter "Name='b8ec3154-9e5f-47a
3-a540-532b04b117e0'"
__GENUS : 2
__CLASS : Msvm_VirtualSwitch
__SUPERCLASS : CIM_ComputerSystem
__DYNASTY : CIM_ManagedElement
__RELPATH : Msvm_VirtualSwitch.CreationClassName="Msvm_VirtualSwitch",Name="b8ec3154-9e5f-47a3-a540-5
32b04b117e0"
__PROPERTY_COUNT : 29
__DERIVATION : {CIM_ComputerSystem, CIM_System, CIM_EnabledLogicalElement, CIM_LogicalElement...}
__SERVER : HYPERV01
__NAMESPACE : root\virtualization
__PATH :
\\HYPERV01\root\virtualization:Msvm_VirtualSwitch.CreationClassName="Msvm_VirtualSwitch",
Name="b8ec3154-9e5f-47a3-a540-532b04b117e0"
Caption : Virtual Switch
CreationClassName : Msvm_VirtualSwitch
Dedicated :
Description : Microsoft Virtual Switch
ElementName : New Virtual Network - renamed
EnabledDefault : 2
EnabledState : 5
HealthState : 5
IdentifyingDescriptions :
InstallDate :
MaxChimneyOffloads : 0
MaxVMQOffloads : 0
Name : b8ec3154-9e5f-47a3-a540-532b04b117e0
NameFormat :
NumLearnableAddresses : 2048
OperationalStatus : {2}
OtherDedicatedDescriptions :
OtherEnabledState :
OtherIdentifyingInfo :
PowerManagementCapabilities :
PrimaryOwnerContact :
PrimaryOwnerName :
RequestedState : 12
ResetCapability : 5
Roles :
ScopeOfResidence :
Status :
StatusDescriptions : {OK}
TimeOfLastStateChange :
PS C:\Windows\system32> $VS = Get-WmiObject -Namespace root\virtualization msvm_virtualswitch -filter "Name='b8ec3154-9e
5f-47a3-a540-532b04b117e0'"
PS C:\Windows\system32> $VS.ElementName = "teste renamed"
PS C:\Windows\system32> $vs
__GENUS : 2
__CLASS : Msvm_VirtualSwitch
__SUPERCLASS : CIM_ComputerSystem
__DYNASTY : CIM_ManagedElement
__RELPATH : Msvm_VirtualSwitch.CreationClassName="Msvm_VirtualSwitch",Name="b8ec3154-9e5f-47a3-a540-5
32b04b117e0"
__PROPERTY_COUNT : 29
__DERIVATION : {CIM_ComputerSystem, CIM_System, CIM_EnabledLogicalElement, CIM_LogicalElement...}
__SERVER : HYPERV01
__NAMESPACE : root\virtualization
__PATH :
\\HYPERV01\root\virtualization:Msvm_VirtualSwitch.CreationClassName="Msvm_VirtualSwitch",
Name="b8ec3154-9e5f-47a3-a540-532b04b117e0"
Caption : Virtual Switch
CreationClassName : Msvm_VirtualSwitch
Dedicated :
Description : Microsoft Virtual Switch
ElementName : teste renamed
EnabledDefault : 2
EnabledState : 5
HealthState : 5
IdentifyingDescriptions :
InstallDate :
MaxChimneyOffloads : 0
MaxVMQOffloads : 0
Name : b8ec3154-9e5f-47a3-a540-532b04b117e0
NameFormat :
NumLearnableAddresses : 2048
OperationalStatus : {2}
OtherDedicatedDescriptions :
OtherEnabledState :
OtherIdentifyingInfo :
PowerManagementCapabilities :
PrimaryOwnerContact :
PrimaryOwnerName :
RequestedState : 12
ResetCapability : 5
Roles :
ScopeOfResidence :
Status :
StatusDescriptions : {OK}
TimeOfLastStateChange :
PS C:\Windows\system32> $vs.put()
Path :
\\localhost\root\virtualization:Msvm_VirtualSwitch.CreationClassName="Msvm_VirtualSwitch",Name="b8ec315
4-9e5f-47a3-a540-532b04b117e0"
RelativePath : Msvm_VirtualSwitch.CreationClassName="Msvm_VirtualSwitch",Name="b8ec3154-9e5f-47a3-a540-532b04b117e0"
Server : localhost
NamespacePath : root\virtualization
ClassName : Msvm_VirtualSwitch
IsClass : False
IsInstance : True
IsSingleton : False
Image - New Virtual Network - renamed
Adriano Signature