Skip to content

Import-LMDevicesFromCSV

Terminal window
Import-LMDevicesFromCSV -FilePath <String> [-PassThru] [-CollectorId <Int32>]
[-AutoBalancedCollectorGroupId <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Terminal window
Import-LMDevicesFromCSV [-GenerateExampleCSV] [-ProgressAction <ActionPreference>] [<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 path to the CSV file containing the device information. This parameter is mandatory when the ‘Import’ parameter set is used.

Type: String
Parameter Sets: Import
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Generates an example CSV file with sample device information. This parameter is optional and can be used with the ‘Sample’ parameter set.

Type: SwitchParameter
Parameter Sets: Sample
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Indicates whether to return the imported devices as output. This parameter is optional and can be used with the ‘Import’ parameter set.

Type: SwitchParameter
Parameter Sets: Import
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Specifies the collector ID to assign to the imported devices. This parameter is optional and can be used with the ‘Import’ parameter set.

Type: Int32
Parameter Sets: Import
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

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: Int32
Parameter Sets: Import
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

  • This function requires valid API credentials to connect to LogicMonitor.
  • The CSV file must have the following columns: ip, displayname, hostgroup. collectorid, collectorgroupid, description, property.name1, property.name2.. are optional.
  • The function creates device groups if they don’t exist based on the host group path specified in the CSV file.
  • If the collector ID is not specified in the CSV file, the function uses the collector ID specified by the CollectorId parameter.