当使用以下代码邀请新用户加入我的Azure AD时,我会遇到通讯组问题。
我想测试输入的电子邮件是否是通讯组电子邮件地址。
有没有一种很好的方法来验证电子邮件地址,比如API调用?
我的后备解决方案是检查异常消息。但这不是最好的解决方案。
try
{
var invitation = new Invitation
{
SendInvitationMessage = false,
InvitedUserEmailAddress = "user@sample.com",
InvitedUserType = "Member",
InviteRedirectUrl = "https://sampledomain.com",
InvitedUserDisplayName = "Sample User",
};
graphClient.Invitations.Request().AddAsync(invitation);
}
catch (ServiceException ex)
{
Console.WriteLine($"Error Creating User : {ex.Message}")
}