Hello everyone,
First of all, I want to thank all Peplink developers for implementing the API — it’s a really great feature. I started working with it because InControl lacks several reports we need, so I decided to collect the required data directly through the API.
We have a large number of vessels equipped with Starlink, which has a 1 TB data limit. This connection is shared between work PCs and crew. When the limit is reached, the speed becomes very low, which we want to avoid. Therefore, we enabled a captive portal for the crew with guest accounts, each having daily data limits.
However, sometimes the limits are still exceeded and the company has to pay for extra traffic. Management is unhappy about this and wants the IT department to prepare a report showing internet usage by crew and work PCs.
The usage report for work PCs is easy to generate in InControl, but the crew traffic is a challenge because InControl shows data usage per device, and we don’t know which user is behind each device. This information can be obtained manually from logs, but it takes an extremely long time.
We also noticed that some users log in using multiple accounts to get more data. We want to identify these users.
That’s why I wanted to extract all required information through the InControl API, store it in SQL Server, and generate structured reports.
I created a PowerShell script that automates the collection and analysis of Captive Portal usage data from the InControl 2 API, with integrated violation detection and persistent storage in a local SQL Server database.
The script does the following:
- Retrieves group-level metadata (local time, time zone).
- Fetches Captive Portal user statistics (bandwidth, status, login time, etc.).
- Pulls event logs (PORTAL type) to detect multi-account usage per client.
- Queries device client details to obtain user device names.
The script runs every 15 minutes, so we get usage statistics at 15-minute intervals.
The goal is achieved, the reports are ready — but now I want more!
We want to automatically control users who abuse the system by using multiple accounts.
Is it possible to ban a user’s device through the API?
I know it can be done through the device’s web interface, but I couldn’t find a way to do it through the API.