Copy-LMDevicePropertyToGroup
Syntax
Section titled “Syntax”SourceDevice (Default)
Section titled “SourceDevice (Default)”Copy-LMDevicePropertyToGroup -SourceDeviceId <String> -TargetGroupId <String[]> -PropertyNames <String[]> [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]SourceGroup
Section titled “SourceGroup”Copy-LMDevicePropertyToGroup -SourceGroupId <String> -TargetGroupId <String[]> -PropertyNames <String[]> [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “Description”The Copy-LMDevicePropertyToGroup function copies specified properties from a source device to one or more target device groups. The source device can be randomly selected from a group or explicitly specified. Properties are copied to the target groups while preserving other existing group properties.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Copy-LMDevicePropertyToGroup -SourceDeviceId 123 -TargetGroupId 456 -PropertyNames "location","department"Copies the location and department properties from device 123 to group 456.Example 2
Section titled “Example 2”Copy-LMDevicePropertyToGroup -SourceGroupId 789 -TargetGroupId 456,457 -PropertyNames "location" -PassThruRandomly selects a device from group 789 and copies its location property to groups 456 and 457, returning the updated groups.Parameters
Section titled “Parameters”-SourceDeviceId
Section titled “-SourceDeviceId”The ID of the source device to copy properties from. This parameter is part of the “SourceDevice” parameter set.
Type: StringParameter Sets: SourceDeviceAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: True (ByPropertyName)Accept wildcard characters: False-SourceGroupId
Section titled “-SourceGroupId”The ID of the source group to randomly select a device from. This parameter is part of the “SourceGroup” parameter set.
Type: StringParameter Sets: SourceGroupAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-TargetGroupId
Section titled “-TargetGroupId”The ID of the target group(s) to copy properties to. Multiple group IDs can be specified.
Type: String[]Parameter Sets: (All)Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-PropertyNames
Section titled “-PropertyNames”Array of property names to copy. These can be only be custom properties directly assigned to the device.
Type: String[]Parameter Sets: (All)Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-PassThru
Section titled “-PassThru”If specified, returns the updated device group objects.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Section titled “Inputs”Outputs
Section titled “Outputs”Requires an active Logic Monitor session. Use Connect-LMAccount to log in before running this function.