How can I alarm the client if it is not registered to the
Manage Anywhere server but trying to connect anyway?

Like, when the agent tries to connect to the Command Server
for patches/updates, give a prompt to the user at the client
side informing him that he is not registered, tell him to
contact the admin, and ensure that there is no improper
connection to the server.