Introducing ConnectWiseManageAPI: PowerShell Automation for MSPs

Stop clicking through ConnectWise Manage for every task. This PowerShell module provides 180+ commands to automate tickets, time entries, reports, and integrations. Eliminate repetitive work with simple scripts.

The Challenge of Manual PSA Management

If you’re running a Managed Service Provider (MSP) or working in IT operations, you know that ConnectWise Manage is an incredibly powerful Professional Services Automation (PSA) platform. It handles everything from ticketing and time tracking to projects and billing. But with great power comes great responsibility—and often, a lot of repetitive clicking.

As MSPs, we automate everything for our clients: patch management, backups, monitoring, you name it. But when it comes to managing our own business operations in ConnectWise Manage, many of us are still clicking through web interfaces, manually updating tickets, copying data between systems, and performing the same tasks over and over.

There had to be a better way.

Enter PowerShell and the ConnectWise Manage API

ConnectWise provides a comprehensive REST API that exposes nearly every function of their platform. This is great news for automation enthusiasts. However, working directly with REST APIs can be tedious:

  • Constructing URLs with proper query parameters
  • Managing authentication headers
  • Handling pagination for large result sets
  • Converting between PowerShell objects and JSON
  • Dealing with API quirks and error handling

That’s where ConnectWiseManageAPI comes in.

What is ConnectWiseManageAPI?

ConnectWiseManageAPI is a PowerShell module that provides a comprehensive wrapper for the ConnectWise Manage REST API. Instead of wrestling with REST calls, you can use familiar PowerShell cmdlets to interact with every aspect of your Manage environment.

The module currently provides 180+ cmdlets covering all major areas of ConnectWise Manage:

  • Service Management: Tickets, service boards, notes, configurations
  • Company Management: Companies, contacts, sites, and relationships
  • Time Tracking: Time entries, timesheets, and approvals
  • Project Management: Projects, phases, team members, and tickets
  • Finance: Agreements, billing, and invoicing
  • System Administration: Members, audit trails, documents, and system info

Why PowerShell?

PowerShell is the natural choice for IT automation, especially in MSP environments. Here’s why:

1. It’s Already in Your Toolkit Most MSPs are already using PowerShell for RMM scripts, Active Directory management, and automation tasks. ConnectWiseManageAPI extends that same skillset to your PSA.

2. Pipeline Magic PowerShell’s pipeline makes it incredibly easy to chain operations together. Want to get all open tickets for a specific company and export them to CSV? One line of code.

3. Integration with Everything PowerShell can interact with virtually any system: Active Directory, Azure, AWS, databases, other APIs. This makes it perfect for building integrations between ConnectWise Manage and your entire technology stack.

4. Scheduled Automation Use Windows Task Scheduler to run PowerShell scripts on a schedule. Daily reports? Automated ticket updates? Scheduled maintenance tasks? All possible.

Real-World Use Cases

Here are just a few ways MSPs are using ConnectWiseManageAPI:

Automated Ticket Creation Your monitoring tools detect an issue and automatically create a ticket with all relevant details, assigned to the right team, on the correct board.

Bulk Operations Update 500 company records with new contact information. Apply changes to multiple tickets matching specific criteria. Operations that would take hours of clicking are done in seconds.

Custom Reporting Extract data from Manage, combine it with information from other sources, and generate custom reports that exactly match your business needs.

Time Entry Automation Automatically create time entries based on activities in other systems. No more forgetting to log time.

Integration Workflows Connect ConnectWise Manage with your RMM, documentation platform, billing system, and more. Build the integrated MSP stack you’ve always wanted.

Data Validation and Cleanup Regularly scan your Manage database for inconsistencies, missing information, or data quality issues, and automatically correct them.

The Master Function Pattern

One of the key design principles of ConnectWiseManageAPI is the “Master Function” pattern. Instead of writing unique code for every single API endpoint, the module uses a layered approach:

User Function (Get-CWMTicket)
    ↓
Master Function (Invoke-CWMGetMaster)
    ↓
Web Request Handler (Invoke-CWMWebRequest)
    ↓
ConnectWise Manage REST API

This architecture provides several benefits:

  • Consistency: All functions behave the same way
  • Maintainability: Bug fixes and improvements benefit all functions
  • Reliability: Centralized error handling and retry logic
  • Flexibility: Easy to add new endpoints as ConnectWise updates their API

Getting Started is Easy

Installing the module is as simple as any PowerShell module:

Install-Module 'ConnectWiseManageAPI'

Once installed, you connect to your Manage server with your API credentials:

$ConnectionInfo = @{
    Server      = 'na.myconnectwise.net'
    Company     = 'YourCompanyID'
    pubkey      = 'your-public-key'
    privatekey  = 'your-private-key'
    clientid    = 'your-client-id'
}

Connect-CWM @ConnectionInfo

And you’re ready to start automating. Here’s a simple example that retrieves all open tickets:

Get-CWMTicket -condition "status/name='Open'" -all

Open Source and Community-Driven

ConnectWiseManageAPI is open source and available on GitHub under the MIT license. The project has grown thanks to contributions from the MSP community:

  • 118 stars on GitHub
  • 69 forks from developers building custom solutions
  • Active issue tracking and feature requests
  • Regular updates and improvements

Whether you’re looking to automate a single task or build a comprehensive integration platform, ConnectWiseManageAPI provides the foundation you need.

What’s Next?

In upcoming blog posts, I’ll dive deeper into:

  • Getting Started: A step-by-step guide to setting up and using the module
  • Advanced Automation: Building complex workflows and integrations
  • Best Practices: Tips and patterns from years of real-world MSP usage

Stay tuned, and if you want to get started right away, check out the project on GitHub or install it from the PowerShell Gallery.


Resources:

Comments