Name of Current User Failing on VMs

I noticed recently that if I run a task or use a relevancy that calls “name of current user” on a VM, it returns: “Singular expression refers to nonexistent object.”

Tested this with fixlet debugger on multiple VMs and get the same result.

Why is this happening and how can I avoid it?

Take a look at this:

https://forum.bigfix.com/t/need-current-logged-in-user-via-relevance-code/26575/2

Thank you! Using “name of logged on user” works but it still doesn’t make sense why “name of current user” works on physical machines but not VMs in one of our environments. I did get someone to test in another VM environment I do not have access to and “name of current user” worked there.

Current User returns the active console (local) user, if logged on, otherwise returns “Does not exist”. For all users that are logged on remotely, for instance through RDP, telnet, ssh, VNC, putty and so on, this inspector returns “Does not exist”.

Thanks for clarifying