Copy-LMDevicePropertyToDevice
Syntax
Section titled “Syntax”SourceDevice (Default)
Section titled “SourceDevice (Default)”Copy-LMDevicePropertyToDevice -SourceDeviceId <string> -TargetDeviceId <string[]> -PropertyNames <string[]> [-PassThru] [<CommonParameters>]SourceGroup
Section titled “SourceGroup”Copy-LMDevicePropertyToDevice -SourceGroupId <string> -TargetDeviceId <string[]> -PropertyNames <string[]> [-PassThru] [<CommonParameters>]Description
Section titled “Description”The Copy-LMDevicePropertyToDevice function copies specified properties from a source device to one or more target devices. The source device can be randomly selected from a group or explicitly specified. Properties are copied to the targets while preserving other existing device properties.
Examples
Section titled “Examples”EXAMPLE 1
Section titled “EXAMPLE 1”Copy-LMDevicePropertyToDevice -SourceDeviceId 123 -TargetDeviceId 456 -PropertyNames "location","department"Copies the location and department properties from device 123 to device 456.
EXAMPLE 2
Section titled “EXAMPLE 2”Copy-LMDevicePropertyToDevice -SourceGroupId 789 -TargetDeviceId 456,457 -PropertyNames "location" -PassThruRandomly selects a device from group 789 and copies its location property to devices 456 and 457, returning the updated devices.Parameters
Section titled “Parameters”-PassThru
Section titled “-PassThru”If specified, returns the updated device objects.
Type: System.Management.Automation.SwitchParameterDefaultValue: FalseSupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-PropertyNames
Section titled “-PropertyNames”Array of property names to copy. These can be only be custom properties directly assigned to the device.
Type: System.String[]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-SourceDeviceId
Section titled “-SourceDeviceId”The ID of the source device to copy properties from. This parameter is part of the “SourceDevice” parameter set.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: SourceDevice Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: true ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-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: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: SourceGroup Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-TargetDeviceId
Section titled “-TargetDeviceId”The ID of the target device(s) to copy properties to. Multiple device IDs can be specified.
Type: System.String[]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''CommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.