Adding Windows Servers to CertMS¶
Overview¶
CertMS can automatically discover and monitor certificates on Windows servers through a lightweight PowerShell agent. The agent runs as a scheduled task, scanning for certificates every 6 hours and reporting back to your CertMS instance. This process can be deployed at scale using SCCM, Group Policy, or other enterprise deployment tools.
Prerequisites¶
Before adding Windows servers, ensure you have:
- Administrative access to the target Windows server(s)
- PowerShell execution permissions on the server(s)
- Network connectivity between the server(s) and your CertMS instance
- Appropriate permissions in CertMS to create API keys
Step-by-Step Configuration¶
Step 1: Create API Key for Server Monitoring¶
The Windows agent requires an API key to authenticate and communicate with CertMS.
Navigate to API Key Management¶
- In the left-hand navigation menu, click the Settings dropdown
- Select API Keys
- Review any existing API keys
Create New API Key¶
- Click Create New API Key
- Complete the API key configuration:
| Field | Configuration |
|---|---|
| Name | Descriptive name (e.g., Windows Server Agent API Key) |
| Description | Optional (e.g., API key for Windows server certificate monitoring) |
| Roles | ✅ Servers Admin (required) |
| ✅ Cert Admin (required) | |
| Expiration Date | Set based on your security policy |
| Active | ✅ Checked (default) |
- Click Create API Key
Save Your API Key¶
Critical
This is the only time you can view the complete API key. Copy and save it in a secure location immediately — you will need it for every server you onboard.
Best Practice: You can use one API key for all Windows servers, or create separate keys per server group depending on your security requirements.
Step 2: Download the Windows Agent¶
- In the left-hand navigation menu, click Servers
- Locate the Download Agents dropdown button
- Select Windows Agent from the dropdown
- The PowerShell script will download to your computer
- Save the script somewhere accessible for deployment
Step 3: Deploy Agent to Target Server¶
Copy Script to Server¶
- Copy the downloaded PowerShell script to the target Windows server
- Place it in a temporary location (e.g.,
C:\Temp\)
Open Elevated PowerShell¶
- Right-click PowerShell or Windows PowerShell
- Select Run as Administrator
- Navigate to the directory containing the script
Step 4: Install the Agent¶
Run the Installation Command¶
Execute the PowerShell script with the required parameters:
.\windows_agent.ps1 -Install -ApiUrl "<api_url>" -ApiKey "<api_key>"
Parameter Details¶
| Parameter | Description | Example |
|---|---|---|
-Install |
Switch to install and onboard the server | (no value needed) |
-ApiUrl |
Your CertMS instance API URL | https://acmecorp.certms.com/certms/api/v2 |
-ApiKey |
The API key created in Step 1 | abcd1234-5678-90ef-ghij-klmnopqrstuv |
Example¶
.\windows_agent.ps1 -Install -ApiUrl "https://acmecorp.certms.com/certms/api/v2" -ApiKey "abcd1234-5678-90ef-ghij-klmnopqrstuv"
What Happens During Installation¶
The installation script will:
- Create a
certmsfolder on the server to store agent files and configuration - Configure the agent with your API credentials
- Create a scheduled task that runs every 6 hours
- Display success messages upon completion
Step 5: Verify Server Onboarding¶
- Return to your CertMS instance
- Navigate to Servers in the left-hand navigation menu
- The newly onboarded server should appear in the servers list
- Verify that certificate data is being collected
Verification Timeline¶
| Event | Timing |
|---|---|
| Initial scan | Trigger manually by running the scheduled task |
| Subsequent scans | Every 6 hours automatically |
| Data visibility | Server and certificates appear after first successful scan |
Enterprise Deployment Options¶
The Windows agent can be deployed at scale using your existing enterprise tooling.
Option 1: SCCM (System Center Configuration Manager)¶
- Create an SCCM package with the PowerShell script
- Configure the installation command with your API URL and key
- Deploy to target server collections
- Monitor deployment status through the SCCM console
Option 2: Group Policy¶
- Create a Group Policy Object (GPO)
- Add the script as a startup or scheduled task script
- Configure script parameters in the GPO
- Link the GPO to the appropriate Organizational Units (OUs)
- Force a policy update or wait for the natural refresh cycle
Option 3: Remote PowerShell¶
- Use PowerShell remoting to deploy to multiple servers simultaneously
- Create a wrapper script to iterate through your server list
- Copy the agent and execute installation remotely
- Collect and log results
Deployment Best Practices¶
- Test first — Deploy to a test server before rolling out enterprise-wide
- Use secure credential storage — Store API keys in a vault or encrypted configuration, not plaintext scripts
- Monitor deployment — Track successful installations and investigate failures
- Document servers — Maintain an inventory of monitored servers
- Schedule maintenance windows — Deploy during low-impact periods
Managing Server Monitoring¶
Viewing Monitored Servers¶
- Navigate to Servers in the left-hand navigation
- View all onboarded servers and their status
- Click any server to view detailed certificate information
Scheduled Task Details¶
| Property | Value |
|---|---|
| Task Name | CertMS Certificate Scanner |
| Frequency | Every 6 hours |
| Run As | Local System account |
| Location | Task Scheduler Library |
Modifying Scan Frequency¶
- Open Task Scheduler on the server
- Locate the CertMS scheduled task
- Modify the trigger schedule as needed
- Save changes
Troubleshooting¶
Common Installation Issues¶
| Issue | Solution |
|---|---|
| PowerShell execution policy error | Run Set-ExecutionPolicy RemoteSigned as administrator |
| API authentication failed | Verify the API key is correct and has Servers Admin + Cert Admin roles |
| Network connectivity issues | Verify firewall allows HTTPS (port 443) traffic to your CertMS instance |
| Script not found | Confirm you're in the correct directory containing the script |
| Scheduled task creation failed | Verify you have administrative privileges on the server |
Server Not Appearing in CertMS¶
If a server doesn't appear after installation:
- Wait 10–15 minutes and check again
- Check the scheduled task ran successfully in Task Scheduler
- Verify API credentials are correct in the agent configuration
- Test network connectivity to your CertMS instance on port 443:
powershell Test-NetConnection <certms-instance> -Port 443 - Confirm the API key is active and has the proper roles assigned
Security Considerations¶
- Protect API keys — Store securely and limit access to authorized personnel
- Use least privilege — API keys should only have the roles they actually need
- Monitor key usage — Regularly review API key activity in Settings > API Keys
- Rotate keys periodically — Update keys according to your security policy
- Audit server access — Track which servers are being monitored
- Secure agent files — Restrict access to the
certmsfolder on each server
Uninstalling the Agent¶
To remove the agent from a server:
- Delete the CertMS scheduled task from Task Scheduler
- Remove the
certmsfolder and its contents from the server - Remove the server record from the CertMS interface
Need help? Contact support at support@certms.com.