The Problem Every MSP Faces
If you’re a Managed Service Provider (MSP) using ConnectWise Automate (formerly LabTech), you know the drill: deploying agents to hundreds or thousands of endpoints, troubleshooting connectivity issues, managing agent versions, and dealing with the occasional “agent went offline and won’t come back” scenario.
Manually managing these agents through the GUI is time-consuming and error-prone. You need automation. You need PowerShell. You need ConnectWiseAutomateAgent.
What is ConnectWiseAutomateAgent?
ConnectWiseAutomateAgent is a comprehensive PowerShell module designed specifically for managing the ConnectWise Automate Windows agent. It provides 24 functions that cover every aspect of agent lifecycle management:
- Installation - Deploy agents with a single command
- Configuration - Manage settings, proxy configuration, and visibility
- Troubleshooting - Access logs, test connectivity, restart services
- Maintenance - Update, reinstall, or remove agents programmatically
The module is open-source (MIT license), actively maintained, and available on the PowerShell Gallery for easy installation.
Why PowerShell?
PowerShell is the lingua franca of Windows automation. If you’re managing Windows endpoints at scale, you’re already using PowerShell. ConnectWiseAutomateAgent brings your RMM agent management into the same ecosystem you’re already using for:
- Active Directory management
- Group Policy operations
- System configuration
- Software deployment
- Compliance reporting
Now your RMM agent becomes just another manageable component in your automation workflow.
Real-World Example: Mass Deployment
Let’s say you just onboarded a new client with 150 workstations. Here’s the traditional approach:
- Log into ConnectWise Automate
- Generate deployment link for the client’s location
- Visit each workstation (or remote in)
- Download and run installer
- Wait for agent to check in
- Repeat 149 more times
Here’s the PowerShell approach with ConnectWiseAutomateAgent:
# Install the module once
Install-Module ConnectWiseAutomateAgent
# Get list of computers from Active Directory
$computers = Get-ADComputer -Filter * -SearchBase "OU=Workstations,OU=NewClient,DC=domain,DC=com"
# Deploy to all computers in parallel
$computers | ForEach-Object -Parallel {
Invoke-Command -ComputerName $_.Name -ScriptBlock {
Install-CWAA -Server "https://automate.yourmsp.com" `
-InstallerToken "your-secure-token" `
-LocationID 42 `
-Hide `
-Rename "YourMSP Monitoring"
}
} -ThrottleLimit 10
Time saved: Hours → Minutes Error rate: Reduced dramatically
Key Features That Save Time
1. Intelligent Installation
The module handles everything the manual process does, plus more:
- Automatically detects and installs .NET Framework 3.5 if missing
- Tests server connectivity before attempting installation
- Handles proxy configurations automatically
- Validates server version compatibility
- Cleans up after itself
- Waits for agent registration before returning success
Install-CWAA -Server "https://automate.msp.com" `
-InstallerToken "abc123" `
-LocationID 100 `
-Proxy "http://proxy.client.com:8080" `
-Hide
2. Troubleshooting Made Easy
Agent offline? Instead of remote desktop and clicking through logs:
# Check what's wrong
Get-CWAAInfo | Format-List
Get-CWAAError -Tail 50
Test-CWAAPort -Server "https://automate.msp.com"
# Quick fixes
Restart-CWAA
Invoke-CWAACommand -Command "Send Status"
# Nuclear option
Redo-CWAA -Server "https://automate.msp.com" -InstallerToken "abc123"
3. Stealth Deployment
Some clients don’t want their users seeing “LabTech” or “ConnectWise” in Add/Remove Programs:
# Hide completely
Hide-CWAAAddRemove
# Or rename to something client-friendly
Rename-CWAAAddRemove -Name "IT Management Agent"
4. Proxy-Aware
Working with clients who have strict firewall policies? No problem:
# Configure proxy for the module
Set-CWAAProxy -ProxyServerURL "http://proxy.client.com:8080"
# Install with proxy settings
Install-CWAA -Server "https://automate.msp.com" `
-InstallerToken "abc123" `
-LocationID 50 `
-Proxy "http://proxy.client.com:8080"
Installation is Instant
# From PowerShell Gallery (recommended)
Install-Module ConnectWiseAutomateAgent
# For older systems without Gallery access
Invoke-RestMethod 'https://raw.githubusercontent.com/christaylorcodes/ConnectWiseAutomateAgent/main/ConnectWiseAutomateAgent.ps1' | Invoke-Expression
That’s it. No dependencies. No complicated setup. Just install and start automating.
Who Should Use This?
MSPs - Manage agents across multiple clients efficiently IT Administrators - Automate internal agent deployment and maintenance System Engineers - Integrate RMM into broader automation workflows DevOps Teams - Include monitoring agent in infrastructure-as-code
Real-World Use Cases
Use Case 1: Automated Onboarding
Create a client onboarding script that deploys the RMM agent as part of a larger provisioning workflow alongside:
- Domain join
- Software installation
- Security configuration
- Baseline compliance checks
Use Case 2: Health Monitoring
Build a scheduled task that runs daily to:
- Check agent status on all endpoints
- Test connectivity to the Automate server
- Automatically restart stuck agents
- Alert if agents fail to respond
Use Case 3: Bulk Updates
When ConnectWise releases a critical agent update:
Get-ADComputer -Filter * | ForEach-Object {
Invoke-Command -ComputerName $_.Name -ScriptBlock {
Update-CWAA
}
}
Use Case 4: Disaster Recovery
Rebuild scenario where you need to redeploy agents quickly:
# Import computer list from backup
$computers = Import-Csv "backup-computers.csv"
# Redeploy all agents with original settings
$computers | ForEach-Object {
Invoke-Command -ComputerName $_.ComputerName -ScriptBlock {
Install-CWAA -Server $using:_.Server `
-LocationID $using:_.LocationID `
-InstallerToken $using:Token
}
}
Open Source and Community-Driven
ConnectWiseAutomateAgent is open source under the MIT license. The code is on GitHub, issues and pull requests are welcome, and the community is growing.
GitHub: https://github.com/christaylorcodes/ConnectWiseAutomateAgent PowerShell Gallery: https://www.powershellgallery.com/packages/ConnectWiseAutomateAgent
Getting Started
- Install the module
Install-Module ConnectWiseAutomateAgent - Check available commands
Get-Command -Module ConnectWiseAutomateAgent - Get help for any function
Get-Help Install-CWAA -Full - Deploy your first agent
Install-CWAA -Server "https://automate.yourmsp.com" ` -InstallerToken "your-token" ` -LocationID 100
What’s Next?
In upcoming posts, we’ll dive deeper into:
- Advanced deployment scenarios - Complex proxy configurations, multi-server failover
- Troubleshooting techniques - Debugging agent issues with PowerShell
- Integration patterns - Using the module with PDQ Deploy, Group Policy, Intune
- Security best practices - Handling installer tokens, securing deployments
Conclusion
If you’re managing ConnectWise Automate agents manually, you’re working too hard. ConnectWiseAutomateAgent brings the power of PowerShell to your RMM operations, saving time, reducing errors, and enabling automation at scale.
The module is free, open source, and ready to use. What are you waiting for?
Try it today:
Install-Module ConnectWiseAutomateAgent
Questions or feedback? Open an issue on GitHub or contribute to the project!
Comments