javascript – Retrieves user information with js and sharepoint

I am faced with the following problem: I need to get users from the entire domain, not just the siteusers list on SharePoint, so that I can manipulate them and, for example, add them to share point groups.

I have the following script:



This retrieves the email from the selected user. The problem is that if I enter a user ID that is not a member of Siteusers, I do not get anything back. Is there a way to search an entire domain via javascript, then create a user object from it?

Thank you