Pulling the list of Endpoints

Hi,

i want to pull the list of all agent including all the agent status not under fleet but on discover because i want to pull the list as csv.

Any one know which query i can run to get what i mentioned?

Thanks