← script library

A Hello World PowerShell Script for Servers

ServerEngine PlatformAugust 17, 2026

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:COMPUTERNAME

Run 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.

Ready when you are.

Try ServerEngine free for 7 days.