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

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

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
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.

    Output

    VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttribute

    Examples


    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

    Feedback

    Was this page helpful?