Works fine, after some adjustments.

It works fine, we just use the check_nrpe command with user_logon as a parameter.

Also we changed the variables to the following format:
$hostname=some.domain.com
$domain=domain.com
$user=domainuser

If we left the variables as they where ([string]$param,]) we would get a syntax error.

And last: . as a hostname does not work for us. Nor does localhost. FQDN works fine. Might have something to do with checking a domain user/machine.

We have a working check, so happy campers. Thanks!