https://rakhesh.com/powershell/get-a-list-of-machine-names-and-logged-in-users/
Get a list of machine names and logged on or active user(s)