Share this post

Link to post

Share on other sites

Pulseway runs these commands as the local system user (as it's a Windows Service). When you run the powershell command locally it runs in the user session which shows correctly your username. Kind in mind that Pulseway runs even if there is no logged in user.

Share this post

Link to post

Share on other sites

I'm still not sure I understand where these commands are being executed. To me, they seem to be executing on the target local machine, because it is able to successfully "SET" the username, however, it can't seem to read the currently logged in user.

I also tested this, but the result is, it simply sets the Pulseway name to the Hostname ...

Share this post

Link to post

Share on other sites

@level42, Pulseway runs scripts as the SYSTEM account. HKEY Current User will be different for the SYSTEM account compared with the HKEY Current User for a logged in user. Try running powershell as the SYSTEM account using psexec and you'll be able to run scripts exactly as the Pulseway service runs them.

Share this post

Link to post

Share on other sites

Ok, after using this script for the last few weeks I realized it was missing just one more thing:

Issue: Tom and Roger have a desktop computer at home and at the office, often Tom or Roger will call from home and I can quickly pull up which computer's below to roger and tom because my script shows last logged in user, but in this case tom and roger have 2 computers, how do I tell which is home and which is work, sure I could tag them but hell I don't want to open the both devices to find the one thats at tom's home, I want to skip that step and see it on the main search box, hence:

Script 1, any time you have a home user you run this script on their pc

Script 3: This will add the tag, in my case "Users Remote Device" in the list of computers in the search, note also I took off the last logon name for Servers, usually its just me and I only wanted to see the server name without the user name but I could easly add it back in.