Solved

Citrix Powershell script help

Posted on 2012-04-04
3
1,468 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 25

Accepted Solution

by:
Coralon earned 500 total points
ID: 37813802
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
ID: 37877209
I was able to figure out the script myself. But thanks for your comments.
0
 
LVL 25

Expert Comment

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

Coralon
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
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.

749 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