Function Get User Object By Username?

That function should do what you want. Are you sure the error is not elsewhere?

You can also try using the get_user_by()(source) function:

$user = get_user_by('login', 'MaryJane');

This is the same as get_userdatabylogin('MaryJane');

tech