Skip to content

Import-LMDevicesFromCSV

Terminal window
Import-LMDevicesFromCSV -FilePath <string> [-PassThru] [-CollectorId <int>]
[-AutoBalancedCollectorGroupId <int>] [<CommonParameters>]
Terminal window
Import-LMDevicesFromCSV [-GenerateExampleCSV] [<CommonParameters>]

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.

Terminal window
Import-LMDevicesFromCSV -FilePath "C:\Devices.csv" -CollectorId 1234

Imports devices from the “Devices.csv” file located at “C:\Devices.csv” and assigns the collector with ID 1234 to the imported devices.

Terminal window
Import-LMDevicesFromCSV -GenerateExampleCSV
Generates an example CSV file named "SampleLMDeviceImportCSV.csv" in the current directory with sample device information.

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: false
Aliases: []
ParameterSets:
- Name: Import
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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: false
Aliases: []
ParameterSets:
- Name: Import
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

Specifies the path to the CSV file containing the device information. This parameter is mandatory when the ‘Import’ parameter set is used.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Import
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Sample
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Import
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.