Oct 10 2023 04:02 AM - edited Oct 10 2023 04:11 AM
Old exchange accounts that were created before 2014-2015 don't have userType field. When we query such users their userType returns null:
https://graph.microsoft.com/v1.0/users/xxx?$select=createdDateTime,userType
How do we differ in such case between Guest and Member accounts?
Oct 11 2023 06:20 AM
Hi @Mark_Babayev,
the solution you can try to validate Guest/Member users for accounts created before 2014 in Microsoft Exchange is:
Get-Mailbox -ResultSize Unlimited | Where-Object {$_.UserType -eq "GuestMailbox" -or $_.UserType -eq "MemberMailbox"}
This will return a list of all Guest/Member users in your organization.
Test-EmailAddress -EmailAddress $user.PrimarySmtpAddress
If the command returns True, then the email address is valid. If the command returns False, then the email address is not valid.
Send-MailMessage -To $user.PrimarySmtpAddress -Subject "Guest/Member Account Validation" -Body "This email is to validate your Guest/Member account. Please click on the following link to validate your account: [Validation link]"
The validation link should point to a web page where the user can enter their email address and password to validate their account.
Set-Mailbox -Identity $user.Identity -UserType $user.UserType
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)