Monday, 15 September 2014

c# - How to programatically delete Azure Active Directory user? -


I am using the following code executes the code fine but does not remove the user.

  IUser deleteuser = new user (); Deleteuser = users.Where (myuser = & gt; MyUase r.MailNickname.Equals ("IshanArora") FirstOrDefault (); If (Delilizer = Null) {deleteuser.DeleteAsync (); }   

I delete the users before retrieving it:

  Delete Private Async Tasks Device () {ActiveDirectoryClient Client = Authentication Helper.GetActiveDirectoryClient (); // Recover user from your display name var user = wait for customer. the user. Where (u = & gt; u.DisplayName == "user two"). ExecuteSingleAsync (); // or retrieve the user with your original name / var user = wait client.Users.Where (u = & gt; u.UserPrincipalName == "user two") ExecuteSingleAsync (); // URL from the URL in the directory from the URL / var user = waiting client.Users.GetByObjectId ("0b34c995-0970-4776-ae87-f66d384f9c45"). ExecuteAsync (); // Cancel the user from the user. DeleteAsync (); }  

You should see that the user has been removed from the Ezoor Portal


No comments:

Post a Comment