public async Task <ActionResult> CreateUser() { var id = Guid.NewGuid().ToString("N").Substring(0, 6); var user = new User { CreationType = "LocalAccount", AccountEnabled = true, GivenName = $"John-{id}", Surname = $"Smith-{id}", DisplayName = $"Megatron{id}", JobTitle = "Sr. Random User", SignInNames = new List <SignInName> { new SignInName() { Type = "emailAddress", Value = $"john-{id}@smith.com" } }, PasswordProfile = new PasswordProfile { EnforceChangePasswordPolicy = false, ForceChangePasswordNextLogin = false, Password = "******" } }; user.SetExtendedProperty(TaxRegistrationNumberPropertyName, $"{DateTime.Now.Millisecond}{DateTime.Now.Millisecond}"); var newUser = await GraphClient.UserCreateAsync(user); return(Json(newUser)); }