Can the User Profile database be wiped or does it need deleted and re-created?

I've recently run a full import, but have way more User Profiles than I need. There were groups included in the containers that shouldn't have been (My Bad).

Is there a simple way to clear the current number of user profiles? Or is it easier just to delete the connection, re-create, then re-import with the refine containers?

Thanks in advance!


As a simplest solution,

  • Delete the User Profile Sync service and reprovision it again!
  • Then recreate the Connection source with the refine containers!

Note: Once you configure the UPS sync service and Before running the full AD import, it's recommended to

  • Configure LDAP filters,
  • Exclude disabled users and
  • Exclude the unrequired objects from the Synchronization Connections source .

Because the filters don't apply on the objects that already in User Profile Sync service.


You can do the following things

  1. Remove the user profile service and start from scratch.Make sure you run MySite cleanup timer job to remove Mysite as well for the user

  2. Use this script to delete all the users from User profile

    $site = new-object Microsoft.SharePoint.SPSite("http://skvkfm-it01/");  
    $ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site);  
    $ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)    
    $AllProfiles = $ProfileManager.GetEnumerator()  
    foreach($profile in $AllProfiles)  
        $DisplayName = $profile.DisplayName  
        $AccountName = $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value  
    #Do not delete setup (admin) account from user profiles. Please enter the account name below 
    if($AccountName -ne "Domain\MySiteSVApp") 
        write-host "Profile for account ", $AccountName, " has been deleted" 

Delete All user profile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.