There are few available options that can be used to detect machines that required an Agent (non managed machines), as explained here:
Discover if all the machines in the environment have an agent
But when running dmsweep scan command, sometimes an existent machine is listed as non managed machine:
Client Automation 14.x
This behavior happens when scanned machines have an Agent, but no DM Primer installed.
A possible workaround is to manually install DM Primer on existent Agent machines, as explained here:
Manual Installation of the Infrastructure Deployment Primer Software
dmsweep is the command line interface of DM Deployment Manager, which is used by Deployment Wizard, so it directly depends on DM Primer to get the required information, for installation and also for scan.
When doing a scan using Deployment Wizard, it first tries to reach the machine using a ICMP echo request, if the machine responds, then it sends a CAM request through DM Primer queue, if it doesn't respond to that, then the machine is marked as "Machine responding", which means the machine is alive and responded the ICMP echo request, but didn't respond to CAM request through DM Primer queue. When this situation happens, it's not possible for Deployment Wizard or dmsweep determine if there is an Agent already installed or not.