web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Pull last login date/time from audit entity (old fetchxml query no longer working)

(0) ShareShare
ReportReport
Posted on by 729

I have been running fetchxml script below to generate last login report for our license management team.  Around May 2021, I start receiving "aggregation not supported" error when running this same script in fetchxml builder / Xrm Tool box.

I have reached out to Microsoft Premier Support and their answer was :

"we got an update that there is a change of “Audit Storage” from Microsoft backend bringing this change to the “FetchXml” request behavior.  

Audit has got migrated from SQL to Cosmos DB, since it has migrated to cosmos DB, the fetchxml approach will not work. This

A communication has been already rolled out to all the tenants 6 months ago and you should find the details of this feature(before it was scheduled to be deployed) in your message centre.

Please check the notifications in our message center about this change documentation."

So far, I have not been able to receive any answer regarding what alternatives we have to retrieve the last login date/time by user data, if anyone was able to find an alternative solution, please let me know.

<fetch aggregate="true" >

  <entity name="audit" >

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

    <filter type="and" >

      <condition attribute="action" operator="eq" value="64" />

      <condition attribute="createdon" operator="last-x-days" value="100" />

    </filter>

    <link-entity name="systemuser" from="systemuserid" to="objectid" link-type="outer" alias="SystemUser" >

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

      <attribute name="title" alias="Title" groupby="true" />

      <attribute name="internalemailaddress" alias="Email" groupby="true" />

      <filter>

        <condition attribute="firstname" operator="neq" value="#" />

      </filter>

    </link-entity>

  </entity>

</fetch>

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi TylerS,

    You can use User Audit Viewer XrmToolBox Plugin for getting the user audit details.

  • TylerS.Dev Profile Picture
    729 on at

    This plugin pulls all login data by each user but it throws error when attempting to export to excel (message below), also, I don't want every login entries for each user, just the latest login date and time for all users, I don't see this functionality in this plugin.

    System.IO.FileNotFoundException: Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

    File name: 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

      at BDK.XrmToolBox.UserAuditViewer.PluginControl.ExportDataSet(DataSet ds, String destination)

      at BDK.XrmToolBox.UserAuditViewer.PluginControl.loginHistoryToolStripMenuItem_Click(Object sender, EventArgs e)

      at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)

      at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)

      at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)

      at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)

      at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)

      at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)

      at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

      at System.Windows.Forms.Control.WndProc(Message& m)

      at System.Windows.Forms.ToolStrip.WndProc(Message& m)

      at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)

      at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    WRN: Assembly binding logging is turned OFF.

    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

    Note: There is some performance penalty associated with assembly bind failure logging.

    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 60 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 51

#3
Satyam Prakash Profile Picture

Satyam Prakash 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans