3 Replies Latest reply on Oct 20, 2017 4:51 AM by Magneet

    View Terminate Session Login Script

    CRad14 Hot Shot

      I was hoping to get some help on a script that would run at user login which would terminate any disconnected desktops the user currently has.


      Although I am very experienced with Powershell and PowerCLI, I am not very familiar with View scripting, and definitely not sure where I would even configure the login script once it was written.


      Any help would be fantastic.



        • 1. Re: View Terminate Session Login Script
          LucD Guru
          User ModeratorsCommunity WarriorsvExpert

          Such a script would have to go into a logon script.

          But there are a couple of questions to be answered, the more important one being the one on security.

          A logon script runs normally under the user's credentials, which means the user would need to have the authority to cancel open sessions.


          With the later Horizon View module, you at least can connect from anywhere, no more need to run such a script on a Connection Server.


          But afaik, there are no examples of such a script in the wild

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: View Terminate Session Login Script
            Magneet Hot Shot

            I can see how this script could be created but like Luc says the user would need to have rights in the horizon admin which is someting I am totally against. then there is  the fact that the module for view doesn't accept current credentials so a password file needs to be created for each user or everytime they login they need to give their credentials a 2nd time which is bad as well.


            Can you please give the use case for this and what are you trying to solve exactely?

            • 3. Re: View Terminate Session Login Script
              Magneet Hot Shot

              In another topic I have created a script for admins to remove single desktops in certain error states maybe this helps you from the admin side of things.


              Re: Reset/Refresh Horizon Desktop in a Problem State using PowerShell