title: Get list of user sessions using a particular remote app using powershell
body: <p>We're putting together a powershell script to deploy new versions of applications onto our servers. We need to get a list of all the <code>RDUserSession</code> objects which are running our application.</p>
  
  <p>We're finding that the <code>Get-RDUserSession</code> command with the -Collection option will return all users on the system, including administrators logged in remotely, but not running a RemoteApp.</p>
  
  <p>What we want to do is kick off all users who are running our Remote Applications so we can perform an update.</p>
  
  <p>Right now we get the list of <code>RDUserSessions</code> and send them all a messaage using <code>Send-RDUserMessage</code>, but we're finding that we are also sending the message, and booting off, admins that are trying to run the script.</p>
  
  <p>Is there a way to get the list of applications running in a <code>RDUserSession</code>?</p>