Releases: logicmonitor/lm-powershell-module
v7.5.0
7.5
New Cmdlets
- Get-LMServiceTemplate: Cmdlet to retrieve service template information.
- New-LMServiceTemplate: Cmdlet to create service templates.
- Remove-LMServiceTemplate: Cmdlet to remove service templates.
Note: These cmdlets are currently for internal use/testing only and do not support LMv1 or BearerToken. When a v3 variant is supported they will be updated to support those auth methods.
Bug Fixes/Changes
- Get-LMDeviceProperty: Fix bug with cmdlet that caused cmdlet to continuously loop when no matching property was found.
- New-LMPushMetricDataPoint: Fix bug caused by using users local time when deriving the datapoint timestamps instead of UTC.
- Fixed a few missing cmdlet alias changes and updated the documentation site to reflect all currently active cmdlets.
v7.4.3
7.4.3
Bug Fixes/Changes
- Added -Form support to Invoke-LMRestMethod to support cmdlets that required form data.
- Added missing alias:
Get-LMDeviceGroupGroups
→Get-LMDeviceGroupGroup
- Fixed missing private function Get-NestedDeviceGroup
v7.4.2
7.4.2
Cmdlet Naming Update:
-
Plural-to-Singular Standardization:
To align with PowerShell best practices and the rest of the module, the following cmdlets have been renamed from plural nouns to singular nouns:Get-LMAuditLogs
→Get-LMAuditLog
Set-LMNormalizedProperties
→Set-LMNormalizedProperty
Remove-LMNormalizedProperties
→Remove-LMNormalizedProperty
New-LMNormalizedProperties
→New-LMNormalizedProperty
Import-LMRepositoryLogicModules
→Import-LMRepositoryLogicModule
Get-LMWebsiteGroupAlerts
→Get-LMWebsiteGroupAlert
Get-LMWebsiteAlerts
→Get-LMWebsiteAlert
Get-LMUsageMetrics
→Get-LMUsageMetric
Get-LMRepositoryLogicModules
→Get-LMRepositoryLogicModule
Get-LMNormalizedProperties
→Get-LMNormalizedProperty
Get-LMNetscanExecutionDevices
→Get-LMNetscanExecutionDevice
Get-LMIntegrationLogs
→Get-LMIntegrationLog
Get-LMDeviceNetflowPorts
→Get-LMDeviceNetflowPort
Get-LMDeviceNetflowFlows
→Get-LMDeviceNetflowFlow
Get-LMDeviceNetflowEndpoints
→Get-LMDeviceNetflowEndpoint
Get-LMDeviceGroupDevices
→Get-LMDeviceGroupDevice
Get-LMDeviceGroupGroups
→Get-LMDeviceGroupGroup
Get-LMDeviceGroupAlerts
→Get-LMDeviceGroupAlert
Get-LMDeviceDatasourceInstanceAlertRecipients
→Get-LMDeviceDatasourceInstanceAlertRecipient
Get-LMDeviceAlertSettings
→Get-LMDeviceAlertSetting
Get-LMDatasourceAssociatedDevices
→Get-LMDatasourceAssociatedDevice
Get-LMCostOptimizationRecommendations
→Get-LMCostOptimizationRecommendation
Get-LMCostOptimizationRecommendationCategories
→Get-LMCostOptimizationRecommendationCategory
Find-LMDashboardWidgets
→Find-LMDashboardWidget
-
Backward Compatibility:
Alias functions for the previous plural-noun cmdlet names have been included for backward compatibility.
Note: These plural-noun alias are considered deprecated and will be removed in a future major release. Please update your scripts to use the new singular-noun cmdlet names.
Bug Fixes:
- This version of Logic.Monitor module addresses some unintended issues introduced in the pervious version of the module. Some cmdlets had been inadvertently updated causing cmdlet is not recognized as a name of a cmdlet, function script file or executable program errors.
Updated Cmdlets:
- New-LMWebsite: If a testLocation parameter is specified the cmdlet will now default to setting the -useDefaultLocationSetting to $false. This was causing some confusion as it was previously always defaulting to $true even when specifying specific locations.
- Get-LMAccountStatus: Added AccessId to the returned LMAuth object.
- New/Set-LMDeviceGroup: Added parameters for setting -DefaultCollectorId, -DefaultAutoBalancedCollectorGroupId and -DefaultCollectorGroupId.
v7.4.1
Change List
7.4.1
Bug Fixes:
- This version of Logic.Monitor module addresses some unintended issues introduced in the pervious version of the module. Some cmdlets had been inadvertently updated causing cmdlet is not recognized as a name of a cmdlet, function script file or executable program errors.
Updated Cmdlets:
- New-LMWebsite: If a testLocation parameter is specified the cmdlet will now default to setting the -useDefaultLocationSetting to $false. This was causing some confusion as it was previously always defaulting to $true even when specifying specific locations.
v7.4
7.4
New Cmdlets:
- Export-LMDashboard: Exports dashboard information from LogicMonitor to a JSON file. This is the same file you would get from performing an export from your LM portal. (requested via @AUrhino)
#Export a dashboard to a JSON file
Export-LMDashboard -Id 123 -FilePath "C:\temp"
Minor Changes:
- All payload formating is now done through a centralized Format-LMData function. A bug was reported where trying to refresh properties to clear a resources custom property list would resulting in the empty customProperties payload getting stripped during formating. (reported via @aggie87).
- An issue was discovered where rate limits could be hit without rate limit backoff being applied. As a result of this change we have over hauled the error handling in this version to ensure all cmdlets properly respect any -ErrorAction perferences you have specified.
- While we do not anticipate any issues with these changes, they do touch pretty much every cmdlet in this module, please report any issues you encounter when using this version.
- Increased integration testing coverage to +130 tests accross many of the different cmdlets in the suite.
- This version of the module cleans up a lot of the tech debt aquired over the years and aims to make the module easier to maintain and for the community to contribute to moving forward.
v7.3.1
7.3.1
Introducing Automation Cmdlets:
This version of the Logic.Monitor module brings the first of many "automation" cmdlets that utilize the core API cmdlets to perform scripted actions within a LogicMonitor portal. These initial cmdlets have been asked for by the community and we are happy to be able to include them directly in the core Logic.Monitor powershell module. As always, please provide feedback and feature requests for automation/cmdlets you would like to see added in the future.
View the Logic.Monitor Documentation: Documentation
-
Invoke-LMDeviceDedupe: Identifies and removes duplicate devices based on sysname or IP address matching. Helps clean up portals with duplicate device entries.
# List duplicates in a specific device group Invoke-LMDeviceDedupe -ListDuplicates -DeviceGroupId 8 # Remove duplicates from entire portal Invoke-LMDeviceDedupe -RemoveDuplicates
-
Import-LMDevicesFromCSV: Bulk imports devices from CSV file with support for custom properties and automatic device group creation.
# Import devices from CSV file Import-LMDevicesFromCSV -FilePath "C:\Devices.csv" -CollectorId 1234 # Generate example CSV template Import-LMDevicesFromCSV -GenerateExampleCSV
-
Import-LMDeviceGroupsFromCSV: Bulk imports device groups from CSV file with support for properties and AppliesTo logic.
# Import device groups from CSV Import-LMDeviceGroupsFromCSV -FilePath "C:\Groups.csv" -PassThru # Generate example CSV template Import-LMDeviceGroupsFromCSV -GenerateExampleCSV
-
Find-LMDashboardWidgets: Searches all dashboard widgets for references to specific datasources. Useful for impact analysis before datasource changes.
# Find widgets using specific datasources Find-LMDashboardWidgets -DatasourceNames @("SNMP_NETWORK_INTERFACES","VMWARE_VCENTER_VM_PERFORMANCE")
-
Copy-LMDevicePropertyToGroup: Copies custom properties from a device to device groups. Excludes sensitive credential properties.
# Copy properties from device to groups Copy-LMDevicePropertyToGroup -SourceDeviceId 123 -TargetGroupId 456,457 -PropertyNames "location","department"
-
Copy-LMDevicePropertyToDevice: Copies custom properties between devices. Excludes sensitive credential properties.
# Copy properties between devices Copy-LMDevicePropertyToDevice -SourceDeviceId 123 -TargetDeviceId 456,457 -PropertyNames "location","department"
v7.3.0
7.3.0
New Cmdlets:
-
Get-LMDiagnosticSource: Retrieves LogicMonitor Diagnostic Sources by ID, Name, DisplayName, or filter. Supports pagination and returns objects of type
LogicMonitor.DiagnosticSource
. -
New-LMDiagnosticSource: Creates a new Diagnostic Source in LogicMonitor using a provided configuration object.
-
Set-LMDiagnosticSource: Updates an existing Diagnostic Source. Supports updating by ID or Name, and only sends fields that are explicitly set. Special handling for the
name
field via the-NewName
parameter. -
Remove-LMDiagnosticSource: Removes a Diagnostic Source by ID or Name.
-
Get-LMServiceGroup: Retrieves LogicMonitor Service Groups by ID, Name, DisplayName, or filter. Supports pagination and returns objects of type
LogicMonitor.DeviceGroup
. -
New-LMServiceGroup: Creates a new Service Group in LogicMonitor.
-
Set-LMServiceGroup: Updates an existing Service Group. Supports updating by ID or Name, and only sends fields that are explicitly set. Special handling for the
name
field via the-NewName
parameter. -
Remove-LMServiceGroup: Removes a Service Group by ID or Name.
Updated Cmdlets:
-
Get-LMLogicModuleMetadata: Added support for
DIAGNOSTICSOURCE
in the-Type
parameter. Improved filtering logic for all parameters. Fixed bug with isInUser filtering not returning all results when omitted. -
Set-LMDatasource, Set-LMDevice, Set-LMDeviceGroup, Set-LMConfigsource, Set-LMPropertysource, Set-LMCollectorGroup, Set-LMTopologysource, Set-LMWebsiteGroup, Set-LMReportGroup, Set-LMRole, Set-LMNetscanGroup, Set-LMRecipientGroup, Set-LMAppliesToFunction, Set-LMAccessGroup: Unified the empty key removal logic and special handling for
name
/NewName
(orgroupName
/NewName
for recipient groups). Now, thename
(orgroupName
) field is only included if-NewName
is specified, matching the new pattern. -
New-LMCachedAccount / Remove-LMCachedAccount: Improved logic for handling credential vaults and metadata validation.
Note on DiagnosticSources:
DiagnosticSources are currently in closed beta and are not fully supported at this time. Only users in the DiagnosticSource closed beta will be able to leverage these cmdlets.
v7.2.2
7.2.2
Updated Cmdlets:
- Get-LMAlert: Starting with portal version 222 you can now add the parameter -customColumns to your bulk alert requests to return up to 5 additional properties under the customColumn key. Previously this was limited to direct /alert/alerts/$id but has been opened up to all alert queries.
Get-LMAlert -customColumns "system.hostStatus,custom.prop,other.prop"
New Cmdlets:
- Get-LMCostOptimizationRecommendations: Cmdlet to the current recommendations available in Cost Optimization. When using filters, consult the LM API docs for allowed filter fields as not all fields support filtering at this time.
#Retrieve cost optimization recommendations using a filter
Get-LMCostOptimizationRecommendations -Filter 'recommendationCategory -eq "Underutilized AWS EC2 instances"'
-
Get-LMCostOptimizationRecommendationCategories: Cmdlet to list the available categories available for recommendations. This cmdlet does not currently support filtering.
-
Get-LMService: Ease of use cmdlet to return service resource info. Currently Get-LMDevice returns these resources but a separate cmdlet has been created to easily distinguished between a device and service. All the same parameters supported in Get-LMDevice are supported with this cmdlet.
-
Get-LMServiceMember: Cmdlet to return members assigned to a service. Supports service retrieval by id, displayName and name.
-
New-Recipient: Utility cmdlet to assist in properly formating recipient arrays for use with *LMRecipientGroup cmdlets. See example for usage.
-
New-RecipientGroup: Cmdlet to create new recipient groups. Use the New-Recipient utility cmdlet to properly construct your recipient list.
-
Set-RecipientGroup: Cmdlet to update specified recipient groups. Supports pipeline input.
-
Remove-RecipientGroup: Cmdlet to remove specified recipient groups. Supports pipeline input.
#This example creates a new LogicMonitor recipient group named "MyRecipientGroup" with a description and recipients built using the New-LMRecipient function.
$recipients = @(
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'email'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'sms'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'voice'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'smsemail'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method '<name_of_existing_integration>'
New-LMRecipient -Type 'ARBITRARY' -Addr '[email protected]' -Method 'email'
New-LMRecipient -Type 'GROUP' -Addr 'Helpdesk'
)
New-LMRecipientGroup -Name "MyRecipientGroup" -Description "This is a test recipient group" -Recipients $recipients
#This example updates a LogicMonitor recipient group named "MyRecipientGroupUpdated" with a description and recipients built using the New-LMRecipient function.
$recipients = @(
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'email'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'sms'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'voice'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method 'smsemail'
New-LMRecipient -Type 'ADMIN' -Addr '[email protected]' -Method '<name_of_existing_integration>'
New-LMRecipient -Type 'ARBITRARY' -Addr '[email protected]' -Method 'email'
New-LMRecipient -Type 'GROUP' -Addr 'Helpdesk'
)
Set-LMRecipientGroup -Id "1234567890" -NewName "MyRecipientGroupUpdated" -Description "This is a test recipient group updated" -Recipients $recipients
v7.2.1
Change List
7.2.1
Updated Cmdlets:
- Remove-LMDeviceGroupProperty: Added pipeline support for passing DeviceGroup objects to this cmdlet for processing.
New Cmdlets:
- Set-LMDeviceGroupProperty: Cmdlet to update the value of a custom property assigned to a device group. Cmdlet takes a -Id or -Name of the device group to be updated along with a -PropertyName and -PropertyValue. This cmdlet has pipeline support for DeviceGroup objects.
- New-LMDeviceGroupProperty: Cmdlet to remove the value of a custom property assigned to a device group. Cmdlet takes a -Id or -Name of the device group to be updated along with a -PropertyName that is to be deleted. This cmdlet has pipeline support for DeviceGroup objects.
Bug Fixes:
- -Filter Parameter: Fixed an issue that caused and invalid filter error when trying to use filters that contains special reserved characters such as ()$&#[].
v7.2.0
Change List
7.2.0
Updated Cmdlets:
- Connect-LMAccount: Added beta support for LM GovCloud tenants. To connect to a GovCloud instance use the -GovCloud switch when connecting. All existing cmdlets have been updated to support GovCloud portals but not all features in Commercial tenants are available in GovCloud.
New Cmdlets:
- Get-LMLogPartition: Retrieves details of existing log partitions.
- Get-LMLogPartitionRetention: Gets the available retention policies for a portal.
- Set-LMLogPartition: Modifies the settings of specified log partitions. Available parameters include Sku, Rentention, Status and Description.
- Set-LMLogPartitionAction: Updates a log partition to resume or pause log ingest.
- New-LMLogPartition: Creates new log partition for log management.
- Remove-LMLogPartition: Deletes specified log partitions from the system. A log partition must have ingest disabled for 24 hours before it can be removed.
Examples:
#Retrieve a specific log partition by name
Get-LMLogPartition -Name "customerA"
#Get a log partition and update its description and disable ingest
Get-LMLogPartition -Name "CustomerB" | Set-LMLogPartition -Description "Offboarded 5/5/25" -Debug -Status inactive
#Remove a disabled log partition
Remove-LMLogPartition -Name "CustomerB" -Confirm:$false
#Resume log ingestion
Set-LMLogPartitionAction -Name "CustomerC" -Action "resume"