Reports the machine name, operating system and build, the account the script is running as and the local time — nineteen lines that use every convention the rest of the library is built on: the log helper, one clear purpose, and a value handed to the next runbook step. It lives in the Custom folder, which is where your own scripts go, so it is the one to copy when you start writing them.
powershell
# Hello Server
# Single use case: report basic identity of the machine the script runs on
#-----------------------------------------------------------------
function Write-Log {
param($Message)
Write-Host "<WRITE-LOG = `"*$Message*`">"
}
$os = Get-CimInstance -ClassName Win32_OperatingSystem
Write-Log "Hello from $env:COMPUTERNAME"
Write-Log "OS: $($os.Caption) (Build $($os.BuildNumber))"
Write-Log "Running as: $env:USERDOMAIN\$env:USERNAME"
Write-Log "Local time: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
# Pass to the next runbook script (ex. use the hostname in a report)
$store = $env:COMPUTERNAMERun it across your fleet
This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.
More in ServerEngine Platform
Write to the ServerEngine Run Log from PowerShell
2026-08-17Pass Data Between Runbook Steps in PowerShell
2026-08-17Read Data from a Previous Runbook Step in PowerShell
2026-08-17Pass Parameters into a PowerShell Script from an API
2026-08-17Reboot a Server and Resume the Runbook
2026-08-17Configure WinRM over HTTPS with a Self-Signed Certificate
2026-08-17Ready when you are.
Try ServerEngine free for 7 days.