Validate Guest/Member users for accounts created before 2014

Copper Contributor

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?

2 Replies

Hi @Mark_Babayev,

the solution you can try to validate Guest/Member users for accounts created before 2014 in Microsoft Exchange is:

  1. Identify all Guest/Member users in your Exchange organization. You can do this by running the following PowerShell command:
 

 

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.

  1. For each Guest/Member user, check to see if they have a valid email address. You can do this by running the following PowerShell command:
 

 

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.

  1. If the Guest/Member user has a valid email address, send them an email to validate their account. You can do this using the following PowerShell command:

 

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.

  1. After the user validates their account, update their UserType property to Guest or Member, depending on their account type. You can do this using the following PowerShell command:
 

 

Set-Mailbox -Identity $user.Identity -UserType $user.UserType

 


Here are some useful links:


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)