Stopped-extension-dll-exceptions in User Profile Sync

February 4 2013 14 comments

Symptons: You get stopped-extension-dll-exceptions in MIIS client while running full or incremental user profile sync.
MIIS Client

At the same time you will get following exceptions in Application log:
Application Log

Fix: This problem arises from user profiles that have URL in PictureURL field, but the picture is not accessible. You can fix this issue by running the following PS script. The script loops through every user profile and makes a HTTP request to the picture URL. If the URL cannot be accessed the script clears PictureURL field.

# Get user profile service
$UserProfileService = @(Get-SPServiceApplication | ? { $_.TypeName -eq "User Profile Service Application" })[0]

    $serviceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($UserProfileService.ServiceApplicationProxyGroup, [Microsoft.SharePoint.SPSiteSubscriptionIdentifier]::Default);
    $profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)

    # Get all profiles
    $allProfiles = $profileManager.GetEnumerator();

    $counter = 0;
    $decCounter = 0;

    # Loop through every profile
    foreach($profile in $allProfiles)

        $url = $Profile['PictureURL'] -as [string];

            # Create HTTP Request
            $req = [system.Net.WebRequest]::Create($url)
            $req.UseDefaultCredentials = $true
            try {
                $res = $req.GetResponse()
            catch [System.Net.WebException] {
                $res = $_.Exception.Response

            $int = [int]$res.StatusCode
            $status = $res.StatusCode

            # If the image cannot be accessed clear the field
            if($int -gt 400)
                Write-Host -NoNewLine $Profile['PreferredName'] "profile picture broken "
                $Profile['PictureURL'].Value = $null;
                Write-Host -ForegroundColor Green "[FIXED]";

        if($deccounter -eq 10)
            Write-Host $counter" user profile checked";

After running this script the User Profile Sync started to work immediately.

Popularity: 3% [?]

14 comments to “Stopped-extension-dll-exceptions in User Profile Sync”

  1. Dave says:

    Ty Ty Ty, spot on. I have been trying to figure that damn thing out for weeks.

  2. Eric says:

    Thanks very much Marko. I got these errrors after a MySite WebApplication name change, and it solved the problem.

  3. You need to take component in a contest for among the most desirable blogs on the internet. I will suggest this website!

    christian louboutin outlets

  4. Barbaros says:

    After Web app restore, problem has started. This helped a lot, thank you very much!!

  5. GTA V Pics says:

    omg, thank you very much for posting this! Grand Theft Auto V looks Wonderful! Is everyone going to wait to play online until after they finish the story? Or are you gonna rip into it and not even bother?

  6. I must thank you for the efforts you have put in writing this
    website. I’m hoping to see the same high-grade blog posts from you later on as well.
    In truth, your creative writing abilities has encouraged me to get my
    own site now ;)

  7. John Chapman says:

    Thanks for posting this. I was receiving “More than one DN specified for the same profile” exceptions, and this (though not seemingly related) resolved it.

  8. Allison says:

    Seems to be fixing my pictures , reporting every 10 checked, but occasionally throwing this error. SP 2010 farm.

    Exception setting “UseDefaultCredentials”: “This property is not supported by this class.”

    Any insight?

  9. Yasir Ahmed says:

    Thanks, this worked for me.

  10. Sören says:

    Thanx very mutch for this helpful hint and the description to figure out and fixing this problem !

  11. Tonia says:

    Everything is very open with a very clear description of the issues.

    It was truly informative. Your website is useful.
    Thanks for sharing!

  12. P33838 says:

    Trying to amend your script to output to a file so that I do not commit any changes until I know how many profiles have the issue but not having any luck. Can you please let me know what I would need to amend to output to a file ?

  13. says:

    Yup, you are exactly Google namely the best for blogging, Google weblog too come fast within quest engines too.

  14. Kyle says:

    The Script fixed my error in the FIM, but i am still not getting my pictures to load from AD. They have copied to SP in a library, but are not showing in the People Directory. How do I fix that?

Leave a Reply