Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Our customer has switched his AD to a new one. We have migrated users in SharePoint, but the User Profile Service doesn’t work for 73 of 7024 users. These users can log in to SharePoint, but doesn’t have access to AD-group content. I’ve tried to follow the post SharePoint 2010–User Information Lists and User Profile Cleanup where I use the following script:

Get-SPServiceApplication
$upa = Get-SPServiceApplication <identity>
Set-SPProfileServiceApplication $upa -GetNonImportedObjects $true
Set-SPProfileServiceApplication $upa -PurgeNonImportedObjects $true

I get no error message, but the 73 user accounts remain. The idea was to run a full user profile sync when the user accounts were removed, but the user accounts are still there. Why doesn’t this work on a SharePoint 2010 Server solution?

share|improve this question
    
Did you find a way to show the progress of the purge imported objects or just take it on faith the command is running? –  Iedaddy Jul 27 '12 at 0:42
    
@Iedaddy Not really - one just have to wait until the script completes, which is OK since it's on a server and one can continue to work elswhere while the script completes. At least I didn't find anything useful while processing the script. –  Benny Skogberg Jul 30 '12 at 8:33
add comment

1 Answer

up vote 1 down vote accepted

As it turns out, the script worked - but it took a long time. On 7000+ users (in my environment) I had to wait more than an hour before I could see any difference. Six hours later the changes where made.

I refined the script above to this:

$upsa = Get-SPServiceApplication | Where-Object {$_.TypeName -like "User Profile Service Application"}

# List all user accounts that is not imported correctly
Set-SPProfileServiceApplication $upsa -GetNonImportedObjects $true

# Remove user accounts not imported correctly 
# Uncomment line below to run
# Set-SPProfileServiceApplication $upsa -PurgeNonImportedObjects $true

# Run a full User Profile Service Syncronisation, and make sure users end up in Profile database.
# If not, users who log in will create new NonImportedObject accounts

This probably happens because you flag the users to be deleted, and not acctually deletes the user within the operation Set-SPProfileServiceApplication $upsa -PurgeNonImportedObjects $true.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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