Loading...

Power Platform-Powered Citrix App for Logging Off Sessions

Power Platform-Powered Citrix App for Logging Off Sessions

What problem does Citrix solve?

Citrix is a software company that provides virtualization and remote access solutions. Their products allow users to access remote servers, desktops, and applications over the internet, using a device of their choice. This can be useful in various situations, such as when a company wants to provide its employees with access to their work computers from home or a user wants to access their desktop from a different location. Citrix's solutions are designed to make remote access easy and secure while providing users with a high-quality experience.

Challenges in using the Citrix environment

As with any technology, Citrix users may face a variety of challenges. Some common challenges that Citrix users may encounter include the following:

  • A stuck, hung, broken session or unhealthy host.

  • Ability to clear user's sessions or recover them by terminating rogue processes.

  • Reducing Service Desk calls and user downtime.

To address these challenges, Citrix provides support and resources to help users troubleshoot and resolve any issues they may encounter. Also, many free scripts and paid tools are available, but they may need to be fixed. This can cause frustration and impact the brand and user satisfaction. Some companies have even set up a separate Citrix environment to run these scripts, but this can be a waste of resources and can still cause issues with Citrix Workspace reconnection. Overall, it cannot be very easy for users.

How can Microsoft Power Platform solve this problem?

A Citrix Cloud session log-off app can be created using Citrix Cloud API, SharePoint List, Power Apps, Power Automate and Power BI. This app can enable users to get back up and running quickly, reducing reliance on Service Desk and even second-level support teams.

To create the app, first, you will need to create a Power Apps canvas app. Within Power Apps, you can use the "Screen" function to add a screen to design log-off the page. On this page, you can add a button that the user can click to initiate the log-off process.

Citrix-Session-Log-Off-App.png

Next, you will need to use Power Automate to create a flow that will handle the log-off process. This flow should be triggered when the user clicks the log-off button on the Power Apps screen.

To create the flow, you need to use the "HTTP" action to call the Citrix Cloud API. The API endpoint for logging off a session is /cvad/manage/Sessions/{id}/$logoff. You will need to provide the required parameters, such as the session ID, in the request URL and the access token in the headers.

Citrix-Session-Log-Off-App-Flow.png

The HTTP connector has indeed become a premium feature. However, Microsoft has stated that only the flow creator needs to be P1 licensed, and users of the flow do not need to be P1 licensed.

Once the request is made, the flow should check for a successful response from the API. The user will be logged off from their Citrix session if the response is successful. You can use the "Respond to PowerApp" action to display a message to the user indicating that the log-off was successful.

Parsing JSON Payload

The ParseJSON function has been introduced, allowing JSON payloads and Power Apps to work together more efficiently. For example, to parse a JSON response sent via the Power Automate HTTP action in Power Apps, follow these steps:

  • In Power Automate, create a new flow, and add an HTTP action to request the desired API. Set the "Response" field to a dynamic content variable, such as "body".

  • Add a "Compose" action to the flow and set the input to the "body" variable. Then, the "Outputs" field extracts the desired data from the JSON response.

  • In Power Apps, add a "Data table" control to display the parsed JSON data.

  • In the "Data table" properties, set the "Items" field to the output of the "Compose" action in Power Automate. This will display the parsed JSON data in the table.

Using this approach, you can quickly parse a JSON response from an HTTP action in Power Automate and display the data in Power Apps. This can be useful for displaying API data in your app or using it in further calculations or actions.

Securely store and access secrets

Azure Key Vault is a service to store and access secrets securely. For example, to securely access Citrix Cloud API client secret in Power Automate using Azure Key Vault, follow these steps:

  • In Azure Key Vault, create a new secret and securely store the Citrix Cloud API client secret you want to access.

  • In Power Automate, add an action to retrieve the password from Azure Key Vault. To do this, you will need to provide the URL of your Azure Key Vault and the secret name.

  • In the next step of the flow, use the "Compose" action to decrypt the password retrieved from Azure Key Vault. Finally, you can use the "base64ToString" function to convert the encrypted password to plain text.

  • You can now use the decrypted password to connect to an external service using the "HTTP" action.

Using Azure Key Vault to store passwords, you can ensure that they are securely encrypted and can only be accessed by authorized users or services. This helps protect sensitive information and prevent unauthorized access.

Citrix Cloud API Reference

Authenticate to Citrix Cloud

To authenticate to Citrix Cloud via the API, you must use an OAuth2 authentication flow. This involves sending a request to the /cctrustoauth2/root/tokens/clients endpoint, along with your client ID and secret, to obtain an access token. Once you have received an access token, you can include it in the Authorization header of your API requests to authenticate.

You can refer to the Citrix Cloud API documentation for more detailed information and specific examples.

Search for sessions in Citrix Cloud Sessions

To search for a Citrix Cloud session using the API, you will need to send a GET request to the /cvad/manage/Sessions/$search endpoint of the Citrix Cloud API. This endpoint allows you to search for sessions using various filters and query parameters, such as the user ID, session ID, and session state.

You can refer to the Citrix Cloud API documentation for more detailed information and specific examples.

Log off a session in Citrix Cloud Session

To log off a Citrix Cloud session using the API, you will need to send a POST request to the /cvad/manage/Sessions/{id}/$logoff endpoint of the Citrix Cloud API. This endpoint allows you to log off a specific session using its session ID.

You can refer to the Citrix Cloud API documentation for more detailed information and specific examples.

Features

The Citrix log-off Power App can include the following features:

  • Self-log-off: Allows users to log-off their sessions.

  • Managers log-off: If a direct report cannot log-off due to a stuck or unresponsive session, their manager can log in to the Power Apps app and terminate the session on their behalf.

  • Helpdesk agents log-off: If a user cannot log-off their session or if their manager is unavailable, a Helpdesk agent can assist by searching for the user in the organization and terminating the session on their behalf.

These options allow users to log-off their Citrix sessions quickly and easily, ensuring that their work is secure and accessible from other devices.

Bonus

You can capture Citrix session log-off events and build reports using a SharePoint list and Power BI. To set up this, follow these steps:

  • In SharePoint, create a new list to store the log-off events. Add columns for the username, log-off time, and other relevant details.

  • In Power Apps, enable the log-off button to send the session log-off events to a SharePoint list. The button-click event should capture the session's username, log-off time, and any relevant details.

  • Please create a new report in Power BI and connect it to SharePoint's log-off events list. Then, use the data in the list to create visualizations and reports that show the log-off events and any relevant trends or patterns.

Using this approach, you can easily capture Citrix session log-off events and build reports using a SharePoint list and Power BI. This can help you monitor user activity and identify potential issues or improvement areas.

That's it! With just a few simple steps, you can create a Citrix Cloud session log-off app using Citrix Cloud API, SharePoint List, Power Apps, Power Automate and Power BI. This app will make it easy for users to log off from their Citrix sessions remotely, ensuring their work is secure and accessible from any device.

References

Published on:

Learn more
Home | Joseph Velliah
Home | Joseph Velliah

Fulfilling God’s purpose for my life

Share post:

Related posts

Power Platform & M365 Dev Community Call – May 23rd, 2024 – Screenshot Summary

The May 23rd, 2024 M365 & Power Platform Development Community Call showcased some exciting updates and demos. Markus Möller gave an impressiv...

1 day ago

MVP Journey and the Impact of Power Platform Communities with Nati Turtledove

In this video, Nati Turtledove shares her journey of becoming an MVP and the impact of Power Platform communities. Nati discusses how she lear...

1 day ago

Save $100 With Power Platform Conference 2024 Discount Code

If you're planning to attend the Power Platform Conference 2024 in Las Vegas from September 18-20, you can use the discount code DEVANEY100 to...

2 days ago

Optimize components with Preferred Solution in Power Platform

In this blogpost, you will discover how to optimize and manage component management with Preferred Solution, a powerful tool in the Power Plat...

2 days ago

Microsoft 365 & Power Platform Call (Microsoft Speakers) – May 21st, 2024 – Screenshot Summary

Get a sneak peek into the Microsoft 365 and Power Platform Call that took place on May 21st, 2024, with this screenshot summary. The community...

3 days ago

Zurich Insurance Group enables developers with Microsoft Power Platform

Zurich Insurance Group has leveraged the power of Microsoft Power Platform to empower both pro and citizen developers to create impactful solu...

3 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy