Skip to content
  • ServerEngine
    • Credentials Store
    • Organize & Bundle Scripts
    • Job Planner
    • Automation
    • Testing Console
    • Monitoring & Logging
    • Remote Desktops
    • Notifications
  • Docs
  • Scripts
  • Updates
  • Pricing
  • ServerEngine
    • Credentials Store
    • Organize & Bundle Scripts
    • Job Planner
    • Automation
    • Testing Console
    • Monitoring & Logging
    • Remote Desktops
    • Notifications
  • Docs
  • Scripts
  • Updates
  • Pricing
ServerEngine – Windows Automation

ServerEngine

  • Introduction
  • Configure WinRM
  • Script and Package Management
  • ServerEngine API
  • Home
  • Docs
  • ServerEngine
  • ServerEngine API

ServerEngine API

The ServerEngine API is used to send jobs to the Job Planner. Only predefined hosts and packages can be assigned via the API. Assigning non-existent hosts or packages will result in them being disabled & saved in the Job Planner. The API is protected with authentication, but communication is not encrypted. If you plan to expose the API to the internet, we strongly recommend using a reverse proxy with HTTPS for secure transmission.

Prepare Windows for API Calls #

Allow your selected port and IP trough your Windows or Linux firewall

Open Windows Defender Firewall #

Create a new inbound rule #

Choose type Port #

Use Protocol TCP and your configured Port #

Allow the connection #

Only select Domain and Private #

Check if rule was created #

Call API from Windows #

Prepare PowerShell Script #

Replace $username and $password with your own ServerEngine credentials if changed.

$username = “admin”
$password = “cforce-it.com”

Replace with a existing PKG you want to assign to the automation.

Time = “17:28” (Format 24h)
Date = “2024/11/04”
RepeatInterval = “One time”
Host = “AD-CA-FS.CForce-IT.network”
Package = “Showcase_Monitoring”
Status = “Enabled”

Intervals

Replace “http://localhost:5000/” with your own ServerEngine IP-Address and port.

Call using PowerShell #
# Define the username and password
$username = "admin"
$password = "cforce-it.com"

# Encode the credentials
$pair = $username+":"+$password
$encodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))

# Create the headers
$headers = @{
    "Content-Type"  = "application/json"
    "Authorization" = "Basic $encodedCredentials"
}

# Create the body
$body = @{
    Time           = "17:28"
    Date           = "2024/11/04"
    RepeatInterval = "One time"
    Host           = "AD-CA-FS.CForce-IT.network"
    Package        = "Showcase_Monitoring"
    Status         = "Enabled"
} | ConvertTo-Json

# Make the POST request
$response = Invoke-WebRequest -Uri http://localhost:5000/ -Method POST -Headers $headers -Body $body

# Output the response content
$response.Content

Call API from Linux #

Prepare Bash Script #

Replace user -u with your own ServerEngine credentials if changed.

-u admin:cforce-it.com (username:password)

Replace “http://localhost:5000/” with your own ServerEngine IP-Address and port.

Replace with a existing PKG you want to assign to the automation.

“Time”: “12:01”, (Format 24h)
“Date”: “2024/08/05”,
“RepeatInterval”: “Repeat: never”,
“Host”: “WIN-SRV-AUS.CForce-IT.network”,
“Package”: “Server Deployment”,
“Status”: “Enabled”

Intervals

Check CURL #

CURL is usually already on most Linux Destributions if not install it with:

Ubuntu/Debian-based systems:

sudo apt install curl -y

Red Hat-based systems (RHEL/CentOS/AlmaLinux)

sudo yum install curl -y

Call using CURL #
curl -u admin:cforce-it.com -X POST http://localhost:5000/ \
     -H "Content-Type: application/json" \
     -d '{
           "Time": "12:01",
           "Date": "2024/08/05",
           "RepeatInterval": "One time",
           "Host": "WIN-SRV-AUS.CForce-IT.network",
           "Package": "Server Deployment",
           "Status": "Enabled"
         }'

Incorporate API Calls into PKG #

Example: VM Deployment with ESXI and Windows Server 2025 configuration after VM creation.

# Define the username and password
$username = "admin"
$password = "cforce-it.com"

# Encode the credentials
$pair = $username+":"+$password
$encodedCredentials = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))

# Create the headers
$headers = @{
    "Content-Type"  = "application/json"
    "Authorization" = "Basic $encodedCredentials"
}

# Create the body
$body = @{
    Time           = "18:00"
    Date           = "2024/12/01"
    RepeatInterval = "One time"
    Host           = "WINSRV2025_TEMP.CForce-IT.network"
    Package        = "Configure_WINSRV2025"
    Status         = "Enabled"
} | ConvertTo-Json

# Make the POST request
$response = Invoke-WebRequest -Uri http://localhost:5000/ -Method POST -Headers $headers -Body $body

# Output the response content
$response.Content
Still stuck? How can we help?

Still stuck? How can we help?

Updated on May 3, 2025
Table of Contents
  • Prepare Windows for API Calls
    • Open Windows Defender Firewall
    • Create a new inbound rule
    • Choose type Port
    • Use Protocol TCP and your configured Port
    • Allow the connection
    • Only select Domain and Private
    • Check if rule was created
  • Call API from Windows
    • Prepare PowerShell Script
    • Call using PowerShell
  • Call API from Linux
    • Prepare Bash Script
    • Check CURL
    • Call using CURL
  • Incorporate API Calls into PKG
  • Home
  • Secure
  • Manage
  • Plan
  • Automate
  • Monitor
  • RMM
  • ChatGPT

License

  • Pricing

Software Updates

  • Updates

Script Library

  • Scripts

Company

  • CForce-IT.com
  • Explore Software

Contact

  • Open support case
  • [email protected]

Docs

  • Introduction
  • Configure WinRM
  • Script and Package Management
  • ServerEngine API
 
 

Copyright © 2025 - ServerEngine.co  by CForce-IT | Icons by Icons8

  • Privacy Policy
  • Imprint