How to get roster status without logging in?

I am trying to login as a random UNLOGGED IN user foo but I want to know if foo has logged in already or not. Is there a way to find out the current active roster and inactives so I can randomly grab an inactive user and login? I tried the getRoster() but it seems i have to be logged in first and anonymous login is not allowed. do have connection to the server though… or is there a way where i can try to login as foo but if I detect that foo is already logged in i can back out without killing the other connection? thanks!