Posted in
Virtual Machine Manager,
Windows Powershell |
No Comment | 3,960 views | 16/05/2009 19:42
Today, i needed to set custom properties to virtual machines. If you saw my VMList script before, I was listing only vm names and operating systems. But today I needed to add IP Address and Vlan ID to that script. But How can I set custom properties to Virtual Machines? It’s really easy.
1
2
3
4
| $strVMName = "VM5051"
$strVlanValue = "VLAN786"
$strCIDR = "192.168.2.0/24"
Set-Vm -VM $strVMName -Custom1 $strVlanValue -Custom2 $strCIDR |
$strVMName = "VM5051"
$strVlanValue = "VLAN786"
$strCIDR = "192.168.2.0/24"
Set-Vm -VM $strVMName -Custom1 $strVlanValue -Custom2 $strCIDR
You can use Set-VM command when you deploy new machines.