"Microsoft.Azure.ActiveDirectory.GraphClient.dll"と "Microsoft.IdentityModel.Clients.ActiveDirectory"を参照ライブラリとして使用しています。は、C#を使用してAzure ADユーザーをプログラムで作成します
これには、 "string Mail {get; set;}"プロパティを含むIUserオブジェクトがあります。 IUserオブジェクトを作成して電子メールを割り当てると、電子メールは割り当てられず、ユーザーは作成されません。 AZURE Active Directoryのユーザープロファイルには、Emailフィールドがあります。 DisplayNameとUserPrincipalNameでユーザーを作成すると、 が表示されますが、DisplayName、UserPrincipalNameおよびMailユーザーは作成されません。
User Create...
protected void btnAdd_Click(object sender, EventArgs e)
{
ActiveDirectoryClient client = AuthenticationHelper.GetActiveDirectoryClientAsApplication();
IUser newUser = new User();
newUser.DisplayName = "New User";
newUser.UserPrincipalName = [email protected]
//newUser.Mail = "[email protected]";
client.Users.AddUserAsync(newUser).Wait(10000);
}
User not Create and Email not assign...
protected void btnAdd_Click(object sender, EventArgs e)
{
ActiveDirectoryClient client = AuthenticationHelper.GetActiveDirectoryClientAsApplication();
IUser newUser = new User();
newUser.DisplayName = "New User";
newUser.UserPrincipalName = [email protected]
newUser.Mail = "[email protected]";
client.Users.AddUserAsync(newUser).Wait(10000);
}