1

When I setup the UPS sync first time, I selected entire domain to import. So that many users are imported and their user profiles are generated. Later I de-select some OUs and make a full sync. I found most of users are being marked as "Profiles missing from import".

My question is how to check number of active profiles and list them? PowerShell is preferred. Thanks.

1

try this one:

#PowerShell Script - List All User Profiles - SharePoint 2010
#The scripts is distributet "as-is." Use it on your own risk. The author give no warranties, guarantees or conditions.

 #Add SharePoint PowerShell SnapIn if not already added
 if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
#Get ServiceContext from associated site
$site = new-object Microsoft.SharePoint.SPSite("http://blog.bugrapostaci.com:8090");  
$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site);  

#Get UserProfileManager from the My Site Host Site context
$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.
    if($AccountName -ne "BLOG\Mossadmin")
    {
        write-host "Profile: ", $AccountName
    }

}  
write-host "Finished." 
$site.Dispose().

Sharepoint 2010 List all imported profile users by PowerShell

is "My Site Cleanup Timer job " enable on your farm, if it is then it will remove all the deleted profiles from profile db.

Account Deletion and SharePoint 2010 User Profile Synchronization

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.