New-CustomAttribute Command | Vmware PowerCLI Reference


This cmdlet creates a new custom attribute. A custom attribute is a user-defined description field of one or more vCenter Server objects.


-Name < String >
[ [-TargetType ] < CustomAttributeTargetType[] > ]
[-Server < VIServer[] > ]


Required Parameter Name Type Position Features Description
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 Server VIServer[] named
  • wildcards
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.




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


This cmdlet retrieves custom attributes.

This cmdlet creates a new custom attribute.

This cmdlet removes custom attributes.

This cmdlet renames a custom attribute.