I've added logic to the Heartbeat.ps1 script to return success, error or warning depending on the application specific check.

I can see this written to a WSDXXXX.tmp.OUT file:

For example:

IDMSETVAR: COMMAND=status
IDMSETVAR: STATUS_LEVEL=error
IDMSETVAR: STATUS_MESSAGE=heartbeat error
IDMSETVAR: STATUS_TYPE=heartbeat

The driver shim trace shows that the heartbeat script executed successfully, but it doesn't seem to send this back to the engine.

(trace): --->DriverShim publisher channel: polling...
(trace): --->DriverShim publisher channel: executing heartbeat
(trace): --->WindowsScript Driver publisher channel: executing heartbeat script
(trace): WindowsScript_executeCommand: Executing command bin\scriptclient.exe "scripts\powershell\Heartbeat.ps1" "C:\Windows\TEMP\WSD54A5.tmp" "C:\Windows\TEMP\WSD112F.tmp"
(trace): WindowsScript_executeCommand: command exited with code 0
(trace): Received document from publicationShim:
(trace): <nds dtdversion="1.1" ndsversion="8.6">
(trace): <source>
(trace): <product version="4.0.2" build="Apr 22 2014 15:39:53" />
(trace): <contact />
(trace): </source>
(trace): <input />
(trace): </nds>
(drv_driver): Driver_registerObjectDn: starting
(drv_driver): Driver_registerObjectDn: ending
(trace): Document consists only of a state; not sending to the remote side
(trace): Returning to publisher.
(trace): <nds dtdversion="2.0" ndsversion="8.x">
(trace): <output />
(trace): <status level="success" />
(trace): </nds>

I have the following config:

DRIVER_INIT_PARAM_auto-loopback-detection=true
DRIVER_INIT_PARAM_script-command=bin\scriptclient.exe
DRIVER_INIT_PARAM_script-trace-file=logs\script-trace.log
DRIVER_INIT_PARAM_script-timeout=120
DRIVER_INIT_PARAM_use-windows-efs=false
DRIVER_INIT_PARAM_script-trace-output=true
DRIVER_INIT_PARAM_name-mapping=LogonNameMap
AUTH_ID=<omitted>
AUTH_CONTEXT=<omitted>
APPLICATION_PASSWORD=<omitted>
windows-service=true
SUBSCRIBER_INIT_PARAM_subscriber-script=scripts\powershell\Subscriber.ps1
INSTALL_PATH=C:\PROGRA~1\Novell\WSDriver\
PUBLISHER_INIT_PARAM_polling-script=scripts\powershell\Poll.ps1
PUBLISHER_INIT_PARAM_heartbeat-script=scripts\powershell\Heartbeat.ps1
PUBLISHER_INIT_PARAM_pub-polling-interval=60
PUBLISHER_INIT_PARAM_pub-heartbeat-interval=30
PUBLISHER_INIT_PARAM_pub-disabled=false