SharePoint 2010/2013 Unable to load Synchronization Connections

 

User Profile Synchronization connection page(http://centraladmin:1234/_layouts/15/mgrdsserver.aspx) can have trouble loading the connections. This can toss the generic error “An error has occurred while accessing the SQL Server database or the SharePoint Server Search service. If this is the first time you have seen this message, try again later. If this problem persists, contact your administrator.”

ULS

Taking a look at the ULS logs from the Central Admin server we can see why it is failing.

02/01/2019 12:33:12.28    w3wp.exe (0x1878)    0x365C    SharePoint Portal Server SharePoint Portal Server User Profiles d3b3 High LoadConnections failed trying to fill the connections list. Most likely during RetriveResources because of permissions — System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://syncserver:5725/ResourceManagementService/MEX that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. —> System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.1.55:5725 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

 

Things to Check

We need to check a few things on ‘syncserver’. First, is the FIM service started in Services.MSC

Can we browse http://syncserver:5725/ (taken from the ULS logs) from the Central Admin server? Below should be what should load.

 

FIREWALLS

Timing out could be due to firewall rules. FIM provisions the firewall Inbound Rules for only Local Subnet.

Changing this from ‘Local subnet’ to ‘Any IP Address’ if the two servers are on different subnets. This should be done for both rules.

 

 

 

 

EncodedServerID in Correlation ID

Correlation IDs can be captured in Fiddlers, Browser Dev tools(F12), or an error page. The problem comes when we want to get the ULS logs.

 

We can run a Merge-SPLogFile but I’d rather not wait and just get the ULS log file from the server. The EncodedServerID is in the correlation ID when we have the. I have PowerShell function that will tell us the EncodedServerID and the server that assigned the correlationID.

How to use this?

Run the PowerShell in the EncodedServerID.PS1.

This can be run from SharePoint servers or any Windows client with PowerShell. We would still need to run Get-SPServer | Select address, EncodedServerId from a SharePoint server in the farm.

Run “Find-EncodedServerId <GUID>”

Running on a server

Running the function on the farm that has the encodedserverID:

Download this here

SharePoint Profile Picture Import 1.3

Link to original post: https://adamsorenson.com/user-profile-picture-import-with-active-directory-import/

A new year, blog home, & version of the picture importer

I have just completed a migration to my new blog home here. This platform will give us a bit more flexibility with design and such. I have been working a many bugs that have been plaguing the profile picture import. I think I have a handle on the majority of the outstanding issues. The major bug we had was the terrible performance for larger pictures. This is now fixed since we don’t need to reset the variable. We are still using Active Directory Import(ADI) and able to do incremental.

New variable

There is one new variable to assist with the “LDAP Server Unavailable” issue. $DCorDomainName(line 20)
is set for a resolvable domain name(Netbios or FQDN) or a Domain Controller.

XML file will auto create

New logic in the script will create the DNLookup if it’s not present. There was another issue where existing users in AD would fail since the sAMAccountName property is not included with incremental syncs. This is resolved by doing a lookup by the DN and add them into the DNLookup.xml.

Download the new version here

SharePoint – PowerShell Script to Remove Users from Site Collection

Site collections still have users that are either disabled or deleted from Active Directory. SharePoint does not have anything out of the box that will clean up these. The reasons to clean these users up is to avoid getting them as a result in the people picker when they should not be showing up. I do have two scripts that will clean these users up. This will be something you want to test out since this is a delete function (leave $RemoveUsers = $false).

WARNING: This will remove users from site collections. This will remove their alerts, personal views, unique permissions, etc. The only way to revert is to restore the site collection or content database from backup.

Just a bit of information about your site…

This script does require some modification to tailor it for your environment. The service account is needed even if it’s the local domain. This was designed this way, so you can use this script for sites that have users from different domains. As stated above, $RemoveUsers is the switch to make this to script to remove the users that were not found in Active Directory. By default, this is set to $false. After everything is set, run “GetUsers”.

CSV is created.

The CSV will be created if any users are in the site collections that are no longer in Active Directory or are disabled. Review this before feeding it through the second script. There might be some accounts you may have false positives or just want to remove a few entries. This script is more straight forward since we are taking that CSV and removing the user from the URL specified in the CSV. I would recommend backing up the content database(s) that could be affected by this script. DeletedADUsersFromsites1.1.ps1 can be downloaded here
The second script can be downloaded here.

Remove-SPTrustedIdentityTokenIssuer : The trusted login provider is in use and cannot be deleted

 

I have a post about the Migration from Windows to ADFS which utilizes the creation of the -UseDefaultConfiguration switch. A few days ago, I created a Trusted Identity Provider with -UseDefaultConfiguration. I did not need it in my test farm anymore, so it was time to delete it.

This failed with this exception:

PS C:\windows\system32> Remove-SPTrustedIdentityTokenIssuer foo

Remove-SPTrustedIdentityTokenIssuer : The trusted login provider is in use and cannot be deleted.

At line:1 char:1

+ Remove-SPTrustedIdentityTokenIssuer foo

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidData: (Microsoft.Share…dentityProvider:SPCmdletRemoveSPIdentityProvider) [Remove-SPTrustedIdentityTok

enIssuer], InvalidOperationException

+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSPIdentityProvider

 

Only Two Checks

There are only two reasons this exception is tossed when trying to remove the Trusted Identity Token Issuer.

  1. Use in the web application authentication providers
  2. Claim Provider with the same name as your Trusted Identity Token Issuer

The first is the obvious choice to check since the Trusted Identity Token Issuer cannot be deleted if used by a web application. If you have numerous web applications with many zones to check, this can take a long time. The PowerShell script below numerates all the web applications and their zones to display the authentications that are enabled in those zones.

 

#Use this to enumerate all authentication providers in use for every zone for every web application

#author: adamsor

 

$log = “C:\logs\authproviders.txt”

$wa = Get-SPWebApplication

foreach($webapp in $wa)

{

$aams = $webapp.alternateurls

foreach($aam in $aams)

{

Write-host $webapp.url $aam.zone -ForegroundColor DarkGreen

$url = $webapp.Url

$zone = $aam.Zone

“$url $zone” | out-file $log -Append -noclobber

Get-SPAuthenticationProvider -WebApplication $webapp -Zone $aam.zone

Get-SPAuthenticationProvider -WebApplication $webapp -Zone $aam.zone | Out-File $log -Append -noclobber

}

 

}

 

Example of the output:


I checked the authentication providers. I have ADFSAdamsor in use and you can see the web application URL and zone at the top. Any that would come up we would just remove the that zone from using the Trusted Identity Token Issuer.

 

Claim Provider

The second check for Remove-SPTrustedIdentityTokenIssuer is Claim Providers that have the same name as the Trusted Identity Token Issuer.

Get-SPClaimProvider will display all the claim providers installed on the farm.

As the screenshot above shows, I have the claim provider that was created with -UseDefaultConfiguration. I was able to remove the claim provider then removed the Trusted Identity Token Issuer.

Remove-SPClaimProvider <NAME>

Remove-SPTrustedIdentityTokenIssuer <NAME>