Overview
This guide prepares a Windows Server so Callgoose SQIBS can fix incidents on it automatically. The automation runner connects over SSH with a key, and runs PowerShell 7 scripts, such as clearing space or restarting a service, the moment an incident opens.
Step 1: Install PowerShell 7
In Windows PowerShell as Administrator (or download the MSI from the PowerShell releases page):
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
pwsh --version
Step 2: Turn on the OpenSSH server
In PowerShell as Administrator:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
Get-Service -Name sshd
Allow SSH through Windows Firewall (Windows usually adds this rule itself; run it if it is missing):
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Allow port 22 only from your automation runner, not from everywhere.
Step 3: Make PowerShell 7 the SSH shell
By default, SSH sessions open cmd.exe. Switch them to PowerShell 7:
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\PowerShell\7\pwsh.exe" -PropertyType String -Force
Restart-Service sshd
Step 4: Sign in with a key, not a password
- On the automation runner (Linux), create a key for this purpose:
ssh-keygen -t ed25519 -f ~/.ssh/callgoose_windows
- Add the public key (
callgoose_windows.pub) as a line inC:\ProgramData\ssh\administrators_authorized_keyson the server (for an administrator account). Add it to the file; do not overwrite keys already there. - Set the file's permissions, which OpenSSH requires:
icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
Restart-Service sshd
Step 5: Test a script over SSH
Save this as C:\scripts\check_disk_space.ps1 on the server:
# Lists free space on every local fixed drive
Get-CimInstance -ClassName Win32_LogicalDisk |
Where-Object { $_.DriveType -eq 3 } |
Select-Object DeviceID,
@{Name = "Size (GB)"; Expression = { "{0:N2}" -f ($_.Size / 1GB) }},
@{Name = "FreeSpace (GB)"; Expression = { "{0:N2}" -f ($_.FreeSpace / 1GB) }}
Then, from the runner:
ssh -i ~/.ssh/callgoose_windows Administrator@<windows-server> "pwsh -File C:\scripts\check_disk_space.ps1"
You see each drive with its size and free space. If you are asked for a password, check the key file and its permissions.
Step 6: Use it in SQIBS
- Create a PowerShell profile with the server and the SSH key, and a PowerShell action with your fix script.
- Add the action to an automation workflow.
- Link the workflow to the API filter that opens the incident, as below.
To troubleshoot SSH on the server, set LogLevel VERBOSE in C:\ProgramData\ssh\sshd_config, restart sshd, and read the OpenSSH/Operational log in Event Viewer.
Fix known issues automatically
Many alerts have a known fix: restart a service, clear a full disk, run a health check. SQIBS can run that fix for you the moment the incident opens. This is event-driven auto remediation. For example, when your monitoring tool reports low disk space on a Windows server, SQIBS runs a PowerShell script that clears temporary files and checks the space again.
Safe by design. SQIBS runs only workflows your own engineers wrote and approved for your environment. Nothing is guessed or generated: the same steps an engineer would run by hand, run sooner. If the workflow does not fix the issue, the engineer is paged as usual.
To set it up, in the same API filter:
- Select Workflow: choose the automation workflow to run when this filter opens an incident.
- If success then make incident resolved: turn on to resolve the incident when the workflow succeeds.
- Waiting time for escalate to escalation policies: how many minutes to give the workflow before paging the on-call engineer.
Start with low-risk workflows, such as a health check, and add fixes as you come to trust them.
Learn more:
- Prometheus: incident auto remediation, a full worked example.
- Automation workflow: build a workflow from actions.
- Run workflows where your systems are: SSH, Bash, PowerShell, Python, Ansible, kubectl, Terraform.