I’ve got the following script; I just need to collect Process ID’s, Usernames, Remote Server Name and any Window Titles relating to the process. I can run this code locally and it lists all the the Window Titles, but when I try to run it remotely, it comes back with nothing.
When I run the simplified code below, I get a table of processes returned from the remote server, so I think it’s a permissions thing, i.e. my instance of the code running remotely can’t see any open windows an their window titles, therefore nothing is returned. Question is, how do I overcome it?
When you are executing remotely that is in a separate, non-interactive session. You can see all processes show no window title over the remote execution.
If you want to pull from an active session, you’ll probably need to utilize Task Scheduler. Here is what I put together to achieve your desired goal. It creates a scheduled task, runs it to export the processes with window titles, then imports the data and cleans up files/task.