Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

How to get the list of Users of an Environment excluding the Users which are "created by SYSTEM" in fetch XML

Posted on by Microsoft Employee

I have a requirement to get the details of last login date and time of a user but I do not want the list of users which are created by system. Please Help me with the fetch XML query for System User entity .

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get the list of Users of an Environment excluding the Users which are "created by SYSTEM" in fetch XML

    Not Fullname as SYSTEM , I want 'records which are created by SYSTEM' ...This I need to exclude .

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to get the list of Users of an Environment excluding the Users which are "created by SYSTEM" in fetch XML

    Hi,

    Your condition should be as below

    Fullname does not eq SYSTEM And

    Fullname does not eq Integration User

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: How to get the list of Users of an Environment excluding the Users which are "created by SYSTEM" in fetch XML

    Hi Anonymousssss,

    Use Fetch XML Builder in XRM Tool Box to play with this query.

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform/Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get the list of Users of an Environment excluding the Users which are "created by SYSTEM" in fetch XML

    @abdul Thanks for your quick response . It is related to audit history .  So we are trying to do this way below :

    <fetch mapping="logical" aggregate="true" version="1.0" >

    <entity name="audit" >

    <attribute name="createdon" alias="LastLoginDate" aggregate="max" />

    <filter>

    <condition attribute="operation" operator="eq" value="4" />

    </filter>

    <link-entity name="systemuser" from="systemuserid" to="objectid" alias="su" link-type="inner" >

    <attribute name="systemuserid" alias="sysid" groupby="true" />

    <attribute name="fullname" alias="fn" groupby="true" />

    <attribute name="domainname" alias="dn" groupby="true" />

    <attribute name="userlicensetype" alias="ult" groupby="true" />

    <attribute name="accessmode" alias="am" groupby="true" />

    <attribute name="isdisabled" alias="id" groupby="true" />

    </link-entity>

    </entity>

    </fetch>

    The response of this fetch XML is that we are able to track the login of normal users along with the SYSTEM users .

    But we do not want SYSTEM Users , what could be the condition in link entity , in this case??

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Super User 2024 Season 1 on at
    RE: How to get the list of Users of an Environment excluding the Users which are "created by SYSTEM" in fetch XML
    [deleted]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans