PoshCorner: Session State Monitoring

7:50 PM
PoshCorner: Session State Monitoring -

Intro

I am big believer in scripting and automation in general - after so years (believe it or not, but I started with Powershell 8 years ago), the possibility of working on tons of exciting projects and with so many amazing people, it just feels natural for me to write scripts on the road without even realizing I'm doing then. And I just realized that this could be useful for someone if I would like to share snippets I am using

Be aware -. PoshCorner scripts will not be too strong, they will not have great documentation and I do not plan to go into the details of how they work . These scripts will be especially useful for anyone who needs to find the syntax or want to build something solid and seeks some direction. There is simply one-shot scripts I usually just type in the console and none of them takes more than 1 hour to create.

All scripts are provided in the state (but that does not mean you should not report any errors that you met) under following warning:

"This software application is you provided "as is" without representation, warranty or condition of any kind. You can use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES, EITHER EXPRESS, IMPLIED, WRITTEN, ORAL oR STATUTORY, INCLUDING wITHOUT LIMITATION WARRANTIES oF MERCHANTABILITY, FITNESS fOR a PARTICULAR PURPOSE, TITLE aND NON-INFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may contain errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (B) it may not be possible to fully functional software application; and (c) Citrix may, without notice or liability to you, cease to provide the current and / or future versions of the software application. In any case, the code must be used to support ultra-hazardous activities, including but not limited to life support or blasting operations. CITRIX, ITS AFFILIATES OR AGENTS BE LIABLE FOR BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY FOR ANY DAMAGES ARISING FROM THE USE OF THE APPLICATION SOFTWARE, INCLUDING WITHOUT LIMITATION DIRECT, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL OTHER SPECIAL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any claim arising from your use, modification or distribution of the code. "

Monitoring session state XenApp session

During typical engagement, I tend to cons-check each configuration change I make normal manual confirmation would simply take too long. - I write automated routines and at the end of the day, I will check if the values are what I expected ...

I like to set persistent policy (and pre launch when using thin office where the application is provided by XenApp) and always configure both timers disconnection and disconnection. My typical basic configuration is 20 minutes to 30 minutes persistent disconnection for persistent disconnection, 1 hour to 3 hours to disconnect and disconnect the current session. But it is easy to make a mistake - for example configure timeouts thanks to the policy only applies to XenDesktop

To check if this configuration works, I just leave active session running overnight and run the following script .. It's pretty simple, one argument that is expected -User (in UserName Domain format). Optionally, you can use the argument -Wait - this means that the session is not yet working and must wait to begin the session

Example of use if the session is already running: ..
Monitor-SessionState.ps1 -User "CITRITE mzugec"

Example of use if the session is not running again :.
Monitor-SessionState.ps1 -User "CITRITE mzugec" -Wait

accordingly, you should be able to see how session state is changing. State refers to the general session state (Active, Disconnected ...) while ApplicationState help with monitoring the persistent policy.
Monitor-SessionState.zip

Zugec Martin

Previous
Next Post »
0 Komentar