Internal Users:
SELECT Id, Name, IsActive, Profile.Name
FROM User
WHERE ProfileId IN (
SELECT Id
FROM Profile
WHERE UserType = 'Standard'
)
Customer Community/Portal Users:
SELECT Id, Name, IsActive, Profile.Name
FROM User
WHERE ProfileId IN (
SELECT Id
FROM Profile
WHERE UserType = 'CSPLitePortal' )
Partner Community/Portal Users:
SELECT Id, Name, IsActive, Profile.Name
FROM User
WHERE ProfileId IN (
SELECT Id
FROM Profile
WHERE UserType = 'CSPLitePortal' )