Kirk Liemohn recently asked a question on the Office 365 Yammer network if there was an API to list all the external users on his tenant. Being the search guy I am, I suggested using the search API to do this.
If I want to list all external users on the Puzzlepart tenant I can fire off the following REST query:
The above query will get the top 500 external users, which happens to be accounts without puzzlepart.com in the AccountName managed property. I’m also just retrieving AccountName and preferredname to limit data transfer, but include any property you need.