New-CustomAttribute
This cmdlet creates a new custom attribute. A custom attribute is a user-defined description field of one or more vCenter Server objects.
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Name | String | named |
|
Specifies a name for the new custom attribute. |
optional | TargetType | CustomAttributeTargetType[] | 1 |
|
Specifies the type of the objects to which the new custom attribute applies. The valid values are VirtualMachine, ResourcePool, Folder, VMHost, Cluster, Datacenter, and $null. If the value is $null the custom attribute is global and applies to all target types. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Output
VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttributeExamples
Example 1
New-CustomAttribute -Name "CompanyName" -TargetType VMHost, VirtualMachine
Creates a new custom attribute named CompanyName for the virtual machines and hosts on the server.
Related Commands
CustomAttribute
This cmdlet retrieves custom attributes.
This cmdlet creates a new custom attribute.
This cmdlet removes custom attributes.
This cmdlet renames a custom attribute.