How to send an email via a script in IGEL OS based on condition, for example, any active Citrix session?


Hello and thanks in advance for your assistance! We are trying to setup a script to find if there are any ICA sessions running from an iGEL TC, if no ICA sessions running from we want to send a email via an external SMTP server. Can this be done from the iGEL TC? Is there a way to use an SMTP client or some other way to get this email out?


Hi

Wondering what the use case is? Could this be done from Director?

I see now you’ve posted in the other channel


Hi Carl, yes I did trying to figure out how to get the script working. I can’t get that done from Director. As far as I know there is no wat for Director to know about the TCs. I am trying to notify via email if any of the autologon iGel TCs are not connected to a XD and they are running at the iGel Desktop.


Hmm ok

Yeh I would think you’d need to script something up that looked at the devices (based on your IGEL naming convention) and if they had active connections.

Good luck 🙂


While we’re dual-threading (multithreading 🙂 ) here… you could use Citrix PowerShell commands from the D.D.C., maybe something like this….

$thin_clients = get-content c:templist_of_thin_clients.txt

foreach ( $thin_client in $thin_clients) {

if (-not (get-brokersession -clientname $thinclientname -sessionstate Active)) {

send-mailmessage

}

}

You would need a list of thin clients, though.


you could do it based on “ICT*” ?


You could probably combine Igel PowerShell commands… whatever the command is to get a list of (online) thin clients, and feed that list into the Citrix PowerShell script.


Yeah that’s a good point, thank you guys!

Do you know if it’s possible to get that data from the iGel DB itself via iGel PS (client name and online) If possible I guess I could try to find a way to use a Citrix PS script to check if there are active XD sessions for any of the client names that are returning from the PS that interrogates the iGel DB. Thanks!

… I forgot to mention we are using the Embebed DB. We could consider the migration if we could get that data from the SQL IGel DB much easier.


@member they are a few ways to achieve that:

Use our IMI: Rest-API, depending of your licensing mode (v10, or v11) it is a separate license or included in the enterprise pack by default

use a view (kb.igel.com/endpointmgmt-6.01/en/views-10323975.html ) and export it

use a DB Script

Continue reading and comment on the thread ‘How to send an email via a script in IGEL OS based on condition, for example, any active Citrix session?’.  Not a member? Join Here!

Learn more, search the IGEL Knowledge Base



Ask a question or comment on the above messasge thread?

Join or log in to the IGEL Community to ask us anything and meet other IGEL customers, partners, and EUC enthusiasts.

Submit a question, or Join Today!


Popular Message Threads


Categories & Tags: