Solved

Citrix Powershell script help

Posted on 2012-04-04
3
1,376 Views
Last Modified: 2012-08-14
Hi Experts,

I'm trying to put a script together so I can have it logoff users who has been disconnected for more than 4 hours in Xendesktop 5. I got the following script from the example:

Get-BrokerSession -Filter { SessionState -eq Disconnected -and SessionStateChangeTime -lt '-1' } | Stop-BrokerSession

This will log off users that was disconnected for 1 day. How do I change it to 4 hours instead of 1 day? Will this script check sessions on all DDCs or only on the DDC that is running the script?

Thanks in advance for your help.
0
Comment
Question by:lo_oscar
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
Coralon earned 500 total points
Comment Utility
You would use a get-date and compare the time..  Since the SessionStateChangeTime uses a datetime object,  it should be easy to compare the two for hours.  

In theory, it won't matter which DDC is running it, because it is querying the database, which will have information about all of the sessions.  Once a session is established the DDC is not involved with the session anymore.  

Do you have apps that won't tolerate a hard/ungraceful shutdown?  Normally, I'd just use the idle timer in the policies to handle this.

Coralon
0
 

Author Closing Comment

by:lo_oscar
Comment Utility
I was able to figure out the script myself. But thanks for your comments.
0
 
LVL 23

Expert Comment

by:Coralon
Comment Utility
Can you post what you came up with?  I'm curious :-)

Coralon
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

After several days of searching and hunting for limited documentation, I wanted to share this guide to hopefully save someone the hassle of trying to figure this out on their own. I have tested this on Xendesktop 7.1 and PS 4.5 running simultaneous…
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now