User Profile Automated Removal when User is Deleted from Active Directory

2 thoughts on “User Profile Automated Removal when User is Deleted from Active Directory

  1. By calling $web.EnsureUser are you not creating the local reference if it wasn’t there before? It checks the role and membership providers for a valid user, if I recall correctly, and there can be more than one. I’m not sure how it works with AD, whether it would go all the way to AD to check the user or whether it consults a local copy of user properties in the site collection like it did with Foundation.

    1. Salut Martin,

      $web.EnsureUser will throw an error because the active profile for the user is no longer found in the SharePoint provider, nor in AD. It therefore won’t create the local reference on sites where the user was not assigned to before.

Leave a Reply to Martin Laplante Cancel reply

Your email address will not be published. Required fields are marked *