Skip to content
All recipes

Find users with no device and devices with no user

Compare directory users with device records to list users who have no device and devices that have no assigned user.

Open in Claude Open in ChatGPT
Product
Endpoint Management
Platforms
All
Effect
Read-only
Agent access
Iru MCP or the Iru API

Before you start

  • An Iru API token with MCP turned on and permissions that cover the calls below (recipe 1).
  • A user directory integration (Google Workspace, Microsoft Entra ID or SCIM) that imports your users (User Directory Integration).

Prompt for your agent

List my directory users in Iru with GET /api/v1/users, and page through every result with the cursor. Keep users where archived is false and device_count is 0. Show me each one's name, email and integration name. Then list my devices with GET /api/v1/devices?limit=300, and page through every result. Show me the devices that have no assigned user. First show me how the user field looks on one device that has no user, and tell me what value you matched on. Don't assign or change anything.

Steps

  1. List the directory users

    The call returns users from your user directory integrations, up to 300 per request. Use the next URL to read every page. The archived filter returns archived or active users only.

    GET/api/v1/users

    Source: Iru API: List Users

  2. Keep users with no device

    Each user record carries a device_count. Keep the active records where device_count is 0, and leave out archived users unless you want them.

    Source: Iru API: List Users

  3. List the devices

    Each device record has a user object with email, name, id and is_archived. The docs don't show what an unassigned device returns there, so have the agent show you one such device and the value it matched on.

    If Windows or Android management is on, the list includes those devices too, with fields that don't apply left blank.

    GET/api/v1/devices?limit=300

    Source: Iru API: List Devices

  4. Assign a user in the web app

    To fix a device with no user, select Devices, select the device, then Edit device details and Edit user. Type the name, then select Assign.

    Source: Assigning and unassigning users to devices

Check it worked

  • Open one listed user in Users and confirm it shows no devices.

Common pitfalls

  • Iru imports directory users every 4 hours, so a new hire can appear a few hours after you add them to the directory.
  • Device users in Iru can only be created and assigned through a directory integration.
  • Removing a directory integration removes the users who aren't assigned to devices.

FAQ

Which call tells me how many devices a user has?

GET /api/v1/users returns a device_count for each user. A value of 0 means no device is assigned.

How often does Iru import directory users?

Every 4 hours once a Google Workspace, Microsoft Entra ID or SCIM integration is set up.

Does it cover Windows and Android devices?

GET /api/v1/devices includes them when Windows or Android management is on.

How do I assign a user to a device?

Select Devices, select the device, then Edit device details and Edit user. Type the name and select Assign.

Next steps

Sources

Stay up to date

Iru's bi-weekly collection of articles, videos, and research to keep IT & Security teams ahead of the curve.