Set-SCCustomProperty

Modifies the properties of a custom property.

Syntax

Set-SCCustomProperty
   [-VMMServer <ServerConnection>]
   -CustomProperty <CustomProperty>
   [-Name <String>]
   [-Description <String>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCCustomProperty
   [-VMMServer <ServerConnection>]
   -CustomProperty <CustomProperty>
   [-Name <String>]
   [-Description <String>]
   -AddMember <CustomPropertyObjectType[]>
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCCustomProperty
   [-VMMServer <ServerConnection>]
   -CustomProperty <CustomProperty>
   [-Name <String>]
   [-Description <String>]
   -RemoveMember <CustomPropertyObjectType[]>
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]

Description

The Set-SCCustomProperty cmdlet modifies the properties of a custom property. Properties that can be modified include the following:

  • Description of the custom property
  • Name of the custom property
  • Add a member to the custom property
  • Remove a member from the custom property

For information about creating a custom property, type Get-Help New-SCCustomProperty -Detailed.

Examples

Example 1: Add a member to a custom property

PS C:\> $CustomProp = Get-SCCustomProperty -Name "Cost Center"
PS C:\> Set-SCCustomProperty -CustomProperty $CustomProp -AddMember "VMHost"

The first command gets the custom property object named Cost Center and stores the object in the $CustomProp variable.

The second command adds the VMHost member to the custom property stored in $CustomProp.

Example 2: Remove a member from a custom property

PS C:\> $CustomProp = Get-SCCustomProperty -Name "Cost Center"
PS C:\> Set-SCCustomProperty -CustomProperty $CustomProp -RemoveMember "VM"

The first command gets the custom property object named Cost Center and stores the object in the $CustomProp variable.

The second command removes the VM member from the custom property object stored in $CustomProp.

Parameters

-AddMember

Specifies an array of members that this cmdlet adds to an object that has the concept of members, such as a group. For example, this cmdlet can add one or more Active Directory® Domain Services domain users or groups to a user role. Specify members in the following formats:

  • Domain\User
  • User
  • User@Domain
  • Domain\LabGroupAlias
  • LabGroupAlias

The lab group alias is an Active Directory Domain Services security group, not an email alias.

Type:CustomPropertyObjectType[]
Accepted values:VM, Template, VMHost, HostCluster, VMHostGroup, ServiceTemplate, ServiceInstance, ComputerTier, Cloud, ProtectionUnit
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-CustomProperty

Specifies a custom property object.

Type:CustomProperty
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Description

Specifies a description for the specified object.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of a VMM object.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RemoveMember

Specifies an array of members that this cmdlet removes from a VMM object that has the concept of membership, such as a group. For example, this cmdlet can removes one or more Active Directory Domain Services domain users or groups from a user role. Specify members in the following formats:

  • Domain\User
  • User
  • User@Domain
  • Domain\LabGroupAlias
  • LabGroupAlias

The lab group alias is an Active Directory Domain Services security group, not an email alias.

Type:CustomPropertyObjectType[]
Accepted values:VM, Template, VMHost, HostCluster, VMHostGroup, ServiceTemplate, ServiceInstance, ComputerTier, Cloud, ProtectionUnit
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False