NinjaOne icon

NinjaOne

Consume NinjaOne API

Actions158

Queries → Get Last Logged On Users Report

AI-generated

Overview

This node interacts with the NinjaOne API to retrieve various reports and data. Specifically, for the "Queries" resource with the "Get Last Logged On Users Report" operation, it fetches a report listing the most recent users logged onto devices managed by NinjaOne. This is useful for IT administrators who want to monitor user activity across their device fleet, audit access patterns, or troubleshoot login issues.

Practical examples include:

  • Generating a list of last logged-on users per device to verify compliance.
  • Tracking user logins over time for security audits.
  • Integrating login data into dashboards or other reporting tools.

Properties

Name Meaning
Df Device filter: a string used to filter the report by specific device criteria.
Cursor Cursor name: a string used for pagination to continue fetching results from a previous call.
Page Size Limit number of records per page: a number specifying how many records to return per request (default 1000).

Output

The node outputs JSON data representing the last logged on users report retrieved from the NinjaOne API. The structure corresponds directly to the API response and typically includes details such as user names, device identifiers, timestamps of last login, and possibly additional metadata about the login events.

No binary data output is produced by this operation.

Dependencies

  • Requires an active NinjaOne API OAuth2 credential configured in n8n for authentication.
  • Depends on the NinjaOne API being accessible and the user having appropriate permissions to query reports.
  • Uses the built-in HTTP request helper with authentication to communicate with the NinjaOne API.

Troubleshooting

  • Common Issues:

    • Invalid or expired API credentials will cause authentication failures.
    • Incorrect or unsupported filter values may result in empty responses or errors.
    • Pagination cursors that are outdated or invalid can cause errors or no further data returned.
  • Error Messages:

    • Errors from the NinjaOne API will be propagated; typical messages might include authorization errors, invalid parameters, or rate limiting notices.
    • If binary data is expected but missing (not applicable here), the node throws an error indicating missing binary data.
  • Resolutions:

    • Verify and refresh API credentials if authentication fails.
    • Check filter and cursor values for correctness.
    • Handle pagination carefully by using the cursor returned from previous calls.

Links and References

Discussion