Import-LMDevicesFromCSV
Syntax
Section titled “Syntax”Import (Default)
Section titled “Import (Default)”Import-LMDevicesFromCSV -FilePath <string> [-PassThru] [-CollectorId <int>] [-AutoBalancedCollectorGroupId <int>] [<CommonParameters>]Sample
Section titled “Sample”Import-LMDevicesFromCSV [-GenerateExampleCSV] [<CommonParameters>]Description
Section titled “Description”The Import-LMDevicesFromCSV function imports devices from a CSV file into LogicMonitor. It requires a valid CSV file containing device information such as IP address, display name, host group, collector ID, and description. The function checks if the user is logged in and has valid API credentials before importing the devices.
Examples
Section titled “Examples”EXAMPLE 1
Section titled “EXAMPLE 1”Import-LMDevicesFromCSV -FilePath "C:\Devices.csv" -CollectorId 1234Imports devices from the “Devices.csv” file located at “C:\Devices.csv” and assigns the collector with ID 1234 to the imported devices.
EXAMPLE 2
Section titled “EXAMPLE 2”Import-LMDevicesFromCSV -GenerateExampleCSVGenerates an example CSV file named "SampleLMDeviceImportCSV.csv" in the current directory with sample device information.Parameters
Section titled “Parameters”-AutoBalancedCollectorGroupId
Section titled “-AutoBalancedCollectorGroupId”Specifies the auto-balanced collector group ID to assign to the imported devices. This parameter is optional and can be used with the ‘Import’ parameter set.
Type: System.Nullable`1[System.Int32]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Import Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-CollectorId
Section titled “-CollectorId”Specifies the collector ID to assign to the imported devices. This parameter is optional and can be used with the ‘Import’ parameter set.
Type: System.Nullable`1[System.Int32]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Import Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-FilePath
Section titled “-FilePath”Specifies the path to the CSV file containing the device information. This parameter is mandatory when the ‘Import’ parameter set is used.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Import Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-GenerateExampleCSV
Section titled “-GenerateExampleCSV”Generates an example CSV file with sample device information. This parameter is optional and can be used with the ‘Sample’ parameter set.
Type: System.Management.Automation.SwitchParameterDefaultValue: FalseSupportsWildcards: falseAliases: []ParameterSets:- Name: Sample Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-PassThru
Section titled “-PassThru”Indicates whether to return the imported devices as output. This parameter is optional and can be used with the ‘Import’ parameter set.
Type: System.Management.Automation.SwitchParameterDefaultValue: FalseSupportsWildcards: falseAliases: []ParameterSets:- Name: Import Position: Named IsRequired: false 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.