How To Exclude Guest Or External Users From A List Of Office 365 Users

Introduction

In this blog, we will learn how to exclude guest or external users from a list of Office 365 Users. This blog is very useful if your requirement is to get all the users of Office 365 Users and only the accounts are active and should no longer be external users.

Implementation

With External Users (Include)

Office365Users.SearchUser({searchTerm:ComboBox1.SearchText})

Refer Fig no. 1

Without External Users (Exclude)

Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),AccountEnabled=true && Not("#EXT#" in UserPrincipalName))

Refer Fig no. 2


Fig No. 1


Fig No. 2

Conclusion

In this way, we have learned how to exclude guest or external users from a list of Office 365 Users.