Difference between revisions of "Script Extracts and Examples (PowerCLI)"

Jump to navigation Jump to search
m
(→‎Virtual Machine: Added "Add Attributes to VMs from CSV")
m (→‎Add Attributes to VMs from CSV: Forgot to end source)
Line 538: Line 538:


=== Add Attributes to VMs from CSV ===
=== Add Attributes to VMs from CSV ===
You have the option in vCentre to create your own custom attributes to any of the standard objects.  This can be incredibly useful if you have a sprawling estate of VM's to manage for various different parts of your company, as you can record information like Owning Dept., Product Family etc against your VM's.  The only problem is that you then have fields that have to be manually updated (that and the fact that the info is only held in a VM's vCentre database records, not its VMX, so if you have to re-add a machine to vCentre, you'll lose the custom attributes you populated.
You have the option in vCentre to create your own custom attributes to any of the standard objects.  This can be incredibly useful if you have a sprawling estate of VM's to manage for various different parts of your company, as you can record information like Owning Dept., Product Family etc against your VM's.   
 
The only problem is that you then have fields that have to be manually updated (that and the fact that the info is only held in a VM's vCentre database records, not its VMX, so if you have to re-add a machine to vCentre, you'll lose the custom attributes you populated.


The following script allows you to update VM attributes from a CSV file (which can be very convenient if you've just deployed 20 VM's for a project).
The following script allows you to update VM attributes from a CSV file (which can be very convenient if you've just deployed 20 VM's for a project).
Line 674: Line 676:
}
}
Stop-Transcript
Stop-Transcript
</source>


== ESX ==
== ESX ==

Navigation menu