Info user and computer name from perpective

Is there a way for an perspective client to get the windows user name and computer name?

I'm pretty sure the answer is no. That would be a browser malware vulnerability.

2 Likes

If you need that, use Vision, not Perspective.

You can get the user name and IP by calling the function: system.perspective.getSessionInfo(). It returns a long string with all of the current connected client sessions and you can pick out the IP and user from a session by finding that session id that matches the id returned from self.session.props.id. It doesn't give computer name though.

No need to search through session info. Those two items are already present in session.props.host and in session.props.auth.user.userName. And more.

But note that the host information is not accurate when the client is behind a NAT router. (Cannot be accurate.)

The information desired by the OP is simply not available in browser-based systems. If you need it in Ignition, use Vision.

2 Likes