Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Is there any way to get currently logged-in User's data in D365 Portal/CRM


         we have requirement to process the currently singed in users in portal. ayn idea how to get all the users which are currently logged in? or how to identify if particular contact is currently logged in or not ?





Super User
Super User


My first guess here would be using the last successful sign-in field from the contact records


  • you need to set the Site Settings Authentication/LoginTrackingEnabled to true
  • for every sign-out there is a security stamp that is updated against the Contact record (adx_identity_securitystamp), as far as I remember it doesn't get updated on the login
  • you can create a new field for "last successful logout" and then populate via workflow after the Security Stamp is updated

This way you would have both sign-in datetime and sign-out datetime.. now you can retrieve logged-in users

I haven't done this myself, but should work




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User

Oliver Rodrigues



Hi @PoojaD,

As Oliver mentioned, Login Tracking is the simplest approach within CDS, but this field is deprecated ( and not recommended for use - Microsoft's recommendation is to utilize an insights/analytics service. Even still, you will need to define what is considered "currently signed in" - is it someone who last logged in 30 mins or less (using login tracking) or last visited a page 30 seconds or less ago (using insights)?

What is the purpose of the request?

Helper II
Helper II

You can use {% %} to get current contact information and onload of the home page call a power automate with pot request, where you will store data about logged in user

thanks Justin, basically my requirement to maintain track of contact logged in currently . suppose 5 users are logged in and working on portal, if 6th person comes and try to login to portal, he should able to access features of portal . if one person is logged out from currently 5 , then 6th person can log in. 



@eliz_talent, thanks. Can you please help me with understanding pot request. how to call that from portal page load. 

thanks in adavance


Hi @PoojaD,

Based on your information, I don't suggest using PowerApps Portals. What you are asking will require server-side management that you won't find availability for. Even if you use Oliver's recommendation to identify the number of users currently "logged in", preventing a login (especially dependent on your authentication approach) is going to be a nightmare, if even possible. Multiple concerns for this request:

  1. You will likely need an active pinging process for logged in users that will constantly ping an endpoint you've setup to identify a user is logged in and using the site
  2. What if a user steps away from their browser to respond to an email for 10 minutes - do they get logged out? What about the data they were working with?
  3. Are you expecting a queue process where first come, first serve is honored? Or whoever happens to login at the time the 5th position is relinquished?
  4. How do you setup for error handling in authentication ("sorry, 5 people are already logged in") for a web application you don't have server-side access to?

Not expecting answers to these, just trying to present concerns I have for the approach. I'd recommend a fully custom application.

Helpful resources

2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,685)