Skip to content

logicmonitor/lm-powershell-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

203 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build PSGallery Release
Test Current Build on PowerShell Core 7.4.1
Test Current Build on Windows Powershell 5.1

General

PowerShell module for accessing the LogicMonitor REST API.

This project is also published in the PowerShell Gallery at https://www.powershellgallery.com/packages/Logic.Monitor/.

Check out the full Logic.Monitor module documenation at: https://logicmonitor.github.io/lm-powershell-module-docs/

Community Contribution Notice: This PowerShell module is an open-source project created and maintained by LogicMonitor users. While not an official LogicMonitor product, it's designed by people who use and understand the platform.

The module is freely available for everyone to use, modify, and improve. We welcome your feedback and contributions! If you have ideas or encounter any issues, please share them through GitHub issues or pull requests.

Many community members rely on this module in their daily operations. Though we can't offer formal support guarantees, our collaborative community strives to address questions and continuously enhance functionality.

We hope you find this tool valuable for your LogicMonitor workflows!

Installation

  • From PowerShell Gallery:
Install-Module -Name "Logic.Monitor"

Upgrading

  • New releases are published often, to ensure you have the latest version you can run:
Update-Module -Name "Logic.Monitor"

General Usage

Before you can use on module commands you will need to be connected to a LM portal. To connect your LM portal use the Connect-LMAccount command:

Connect-LMAccount -AccessId "lm_access_id" -AccessKey "lm_access_key" -AccountName "lm_portal_prefix_name"

Once connected you can then run an appropriate command, a full list of commands available can be found using:

Get-Command -Module "Logic.Monitor"

To disconnect from an account simply run the Disconnect-LMAccount command:

Disconnect-LMAccount

To cache credentials for multiple portals you can use the command New-LMCachedAccount, once a credential has been cached you can reference it when connecting to an lm portal using the -UserCachedCredentials switch in Connect-LMAccount.

Cached credentials are stored in a LocalVault using Microsoft's SecretManagement module. If its your first time using SecretManagement you will be prompted to set up a password for accessing your cached accounts in the LocalVault using this method.

New-LMCachedAccount -AccessId "lm_access_id" -AccessKey "lm_access_key" -AccountName "lm_portal_prefix_name"
Connect-LMAccount -UseCachedCredential

#Example output when using cached credentials
#Selection Number | Portal Name
#0) portalname
#1) portalnamesandbox
#Enter the number for the cached credential you wish to use: 1
#Connected to LM portal portalnamesandbox using account

Change List

7.9.5

New Cmdlets

  • Action chains: Get-LMActionChain, New-LMActionChain, Set-LMActionChain, Remove-LMActionChain
  • Action rules: Get-LMActionRule, New-LMActionRule, Set-LMActionRule, Remove-LMActionRule
  • Log alert pipelines: Get-LMLogAlertGroup, New-LMLogAlertGroup, Set-LMLogAlertGroup, Remove-LMLogAlertGroup
  • Log alert processors: Get-LMLogAlert, New-LMLogAlert, Set-LMLogAlert, Remove-LMLogAlert
  • Diagnostic & remediation: Get-LMDiagnosticRemediationModule, Get-LMDiagnosticRemediationExecutionResult
  • Escalation chains: New-LMEscalationChain, Set-LMEscalationChain
  • SDTs: New-LMCollectorSDT, New-LMWebsiteSDT, New-LMWebsiteGroupSDT

Updated Cmdlets

  • SDT scheduling overhaul: New-LMDeviceSDT, New-LMDeviceGroupSDT, New-LMDeviceDatasourceSDT, New-LMDeviceDatasourceInstanceSDT, and Set-LMSDT now support -ScheduleWizard for interactive schedule creation, -Duration for length-based one-time SDTs, multiple weekdays for recurring schedules, and -3 for last-day-of-month monthly SDTs.
  • Log partition contracts: New-LMLogPartition and Set-LMLogPartition now support contract interval, usage limit, stop-on-limit, and auto-restart-on-renewal settings. Get-LMLogPartition surfaces activeContract fields (retention, sku, usageLimit, etc.) as top-level properties.
  • Device log collector: New-LMDevice and Set-LMDevice now expose -IsPreferredLogCollectorConfigured (with -EnableLogCollector alias on Set-LMDevice) for the preferred log collector setting.

Bug Fixes

  • Get-LMAlert: -ClearedAlerts is now optional and nullable; omitting it returns both cleared and active alerts instead of defaulting to uncleared only. Filter and sort query parameters are now URL-encoded correctly.
  • Get-LMDeviceDatasourceInstance: Fixed datasource lookup when filtering by -DatasourceName or -DatasourceId.

Previous Release Notes

License

Copyright, 2026, LogicMonitor, Inc.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

About

PowerShell module for accessing the LogicMonitor REST API.

Resources

License

Security policy

Stars

23 stars

Watchers

7 watching

Forks

Packages

 
 
 

Contributors