How to Sccm query Mac from active network?

I'm new to SQL and I'm getting an error from sccm osd and failing to find any task sequences on an active network.
How do I sccm query mac from active network?
Suggestions would be highly appreciated.
Thanks.
