NinjaOne icon

NinjaOne

Consume NinjaOne API

Actions158

Devices → Get Device Last Logged On User

AI-generated

Overview

This node interacts with the NinjaOne API to retrieve information about devices and their associated data. Specifically, the "Get Device Last Logged On User" operation fetches details about the last user who logged onto a specified device. This is useful in IT management scenarios where administrators need to track device usage or audit user activity on endpoints.

Practical examples include:

  • Identifying which user last accessed a particular workstation.
  • Auditing device usage for security compliance.
  • Integrating device-user data into broader asset management workflows.

Properties

Name Meaning
Id The unique identifier of the device for which to retrieve the last logged-on user.

Output

The node outputs JSON data representing the last logged-on user information for the specified device. The exact structure depends on the NinjaOne API response but typically includes user details such as username, user ID, login timestamp, and possibly other metadata related to the login session.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the NinjaOne API.
  • Needs an API authentication token configured via OAuth2 credentials within n8n.
  • The node uses the NinjaOne OAuth2 credential type (configured externally) to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or missing device Id parameter will cause the API call to fail.
    • Authentication errors if the OAuth2 token is expired or misconfigured.
    • Network connectivity problems preventing access to the NinjaOne API endpoint.
  • Error messages:

    • "No binary data exists on item!" or similar are not relevant here since this operation does not handle binary data.
    • API error responses will be returned in the json.error field if "Continue On Fail" is enabled.
  • Resolutions:

    • Ensure the device Id is correctly provided and corresponds to an existing device.
    • Verify that the NinjaOne OAuth2 credentials are valid and have necessary permissions.
    • Check network settings and firewall rules to allow outbound API calls.

Links and References

Discussion