Skip to content

Installation and Setup

Installation

The Logic.Monitor PowerShell module is available on the PowerShell Gallery and works with PowerShell 5.1+ (some features require PowerShell 6.1+).

Terminal window
# Install from PowerShell Gallery
Install-Module -Name "Logic.Monitor"
# Import the module
Import-Module Logic.Monitor

Authentication

Before using any module commands, you need to connect to your LogicMonitor portal.

API Token (LMv1)

Most common method using API access credentials.

Terminal window
Connect-LMAccount `
-AccessId "your_access_id" `
-AccessKey "your_access_key" `
-AccountName "your_portal"

Bearer Token

Use OAuth bearer tokens for authentication.

Terminal window
Connect-LMAccount `
-BearerToken "your_bearer_token" `
-AccountName "your_portal"

Using Cached Credentials

The module includes secure credential caching using Microsoft’s SecretManagement module for managing multiple portal connections.

Terminal window
# First time: Create a cached credential
New-LMCachedAccount `
-AccessId "your_access_id" `
-AccessKey "your_access_key" `
-AccountName "production-portal"
# Add more portals as needed
New-LMCachedAccount `
-AccessId "staging_id" `
-AccessKey "staging_key" `
-AccountName "staging-portal"

Quick Start Examples

Once connected, here are some common operations to get you started:

Terminal window
# List all devices
Get-LMDevice
# Get a specific device
Get-LMDevice -Name "device.example.com"
# Find devices by pattern
Get-LMDevice -DisplayName "prod*"
# Filter devices by property
Get-LMDevice -Filter "hostStatus -eq 'normal'"
# Create a new device
New-LMDevice `
-Name "server01.example.com" `
-DisplayName "Production Server 01" `
-PreferredCollectorId 5 `
-Properties @{
environment = "production"
location = "us-east"
}

Next Steps

📚 Command Reference

Browse the complete command reference with detailed parameter documentation and examples.

View Commands →

💡 Examples

Explore practical examples for common automation tasks and workflows.

See Examples →

🔍 Advanced Filtering

Learn how to construct powerful filters to query resources efficiently.

Learn Filtering →

🌐 Custom API Requests

Access any LogicMonitor API endpoint directly with full control.

API Requests →

🐛 Debugging

Master debugging techniques and troubleshooting for your scripts.

Debug Guide →

⚡ Pipeline Usage

Efficiently chain commands together using PowerShell pipelines.

Pipeline Guide →