Stopped-extension-dll-exceptions in User Profile Sync

February 4 2013 9 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]

if($UserProfileService)
{
    $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)
    {
        $counter++;
        $decCounter++;

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

        if($url)
        {
            # 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;
                $Profile.Commit();
                Write-Host -ForegroundColor Green "[FIXED]";
            }
        }

        if($deccounter -eq 10)
        {
            Write-Host $counter" user profile checked";
            $decCounter=0;
        }
    }
}

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

Popularity: 3% [?]

9 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.

Leave a Reply