Monday, 12 March 2012

Troubleshoot User Profile Sync in SharePoint 2010


Troubleshoot User Profile Sync in SharePoint 2010

Lately I have been encountering issues after issues with User Profile service application and on further research found this excellent troubleshooting approach in the form of an Visio chart.


I have found this here, may also help others:

Friday, 9 March 2012

The management agent "MOSS-244b2662-ff5e-43ef-b757-40c86630fd35" failed on run profile "MOSS_DELTAIMPORT_cbbb1a7b-67ed-4f8d-90ae-f942cc80ca0c" because the server encountered errors

When you run a full /incremental synchronization in user profie service app, it throws the management error in event logs and doesn’t complete/run the user profile import from Active Directory to SharePoint.
Launch Synchronization server manager; here is how to do it:
Remote desktop to the server on which you have got User Profile server up and running
Navigate to the path: C:\Program files\Microsoft Office Server\14.0\Synchronization Service\UIShell\
Double click on miisclient.exe, this will launch synchronization server manager
Found that Extensible Connectivity agent was failing with a status of stopped-extension-dll-exception via the Synchronization server manager.
It was caused due to an incorrect url and port change for the central admin. FIM had a stale URL which we no longer use. Here is how I fixed it:
  1. Navigate to C:\Program files\Microsoft Office Server\14.0\Synchronization Service\UIShell\
  2. Launch miisclient.exe
  3. Click the ‘Management Agents’ button in the toolbar to switch to the “Management Agents” pane
  4. Right click on the Management Agent with the “Extensible Connectivity” type called MOSS-{guid} and select “Properties”
  5. Click on the “Configure Connection Information” property pane
  6. At the bottom of the dialog, there should be a “Connection information” section which includes a “Connect To:” text box
  7. Change the hostname of the URI in this text box to direct://{HOST}:{PORT}…
  8. Click OK, and close the Synchronization Service Manager (miisclient)
  9. Start a full import and everything should now work.

This report failed to load because session state is not turned on

"This report failed to load because session state is not turned on" when you try to view Microsoft Access Services reports

When you access the reports on access web based site it throws an error This report failed to load because session state is not turned on

Enable the session state via PowerShell and that resolves the issue.

Enable-SPSessionStateService

Prompts for the Database Name: <Databasename>

Example: Enable-SPSessionStateService  AccessReportsDB

There is nice article from Microsoft on how to fix this.

Error: Access Services is unable to process the request

Error: Access Services is unable to process the request

Checked the permissions of the service account on database as well as on service application all was well with it. We recently installed Service Pack 1 and later June 2011 cummulative update in our environment. That seems to disturb the security token service.

Run the following PowerShell to resolve the issue.

PS c:\> Get-SPServiceApplication
PS c:\> $sts = Get-SPServiceApplication | ?{$_ -match "Security"}
PS c:\> $sts
PS c:\> $sts.Status
PS c:\> $sts.Provision()

IISreset  and once iis was reset, we were all good to leverage our access based sites. 

Wednesday, 7 March 2012

Reset SharePoin 2010 farm passphrase powershell


As a part of SharePoint’s migration from pilot to new production environment we had to Join two new application servers but somehow the old farm passphrase didn’t work when  joining the application server in the farm may be I had an incorrect password. Anyways, this life saving PowerShell command helped massively to change the farm passphrase.

Open the SharePoint 2010 Management Shell

Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell

Enter this at the PowerShell prompt:

$passphrasereset = ConvertTo-SecureString -asPlainText -Force

Input the new passphrase and hit Enter
Enter this at the PowerShell prompt:

$Set-SPPassPhrase -PassPhrase $passphrasereset -Confirm

You will be asked to confirm the passphrase by re-entering it.  Re-enter the passphrase and hit Enter

You will be asked if you are sure that you want to perform this action, type Y (for Yes) and hit Enter. 

Your farm passphrase has now been reset!

The security validation for this page is invalid in InfoPath form

Error  Message : Failed to get SPGroupName from GroupID. Error Message: Group cannot be found. Callstack: at Microsoft.SharePoint.SPGroupCollection.Get ByID(Int32 id) at Microsoft.SharePoint.WebControls.PeopleEditor.set_SharePointGroupID(Int32 value). 
The security validation for this page is invalid in InfoPath form

Most of the articles suggest to disable Web Page Security Validation in the Web Application settings which is alright to fix the issue on a temporary basis specially if its not a production environment. Here are the steps:
  1. Open Central Administration -> Manage Web Applications -> General Settings
  2. Web Page Security Validation -> Off.
  3. OK
If it’s a production environment I wouldn’t suggest using this as a solution could cause serious security risk. I was able to resolve this by adding an entry here:

Under the 14 hive, under template/layouts, find the formserver.aspx file. 
Backup the file and then edit it with any text tool, say, notepad.
Under the <body> tag, add the highlighted line of code.

<body runat="server" id="PageBody">
<SharePoint:FormDigest runat="server" />

Save it.

iisreset won’t hurt

You may have to do this if on each server . In my case, I had to republish the InfoPath form as an administrator approved form and change the form template in the form library to the published form content type which solved the issue after adding the entries in formserver.aspx. 

Thanks to MSDN for offering this solution. Saved time !

Change SharePoint central admin port number


In my current environment we had 2 wfe’s in our environment with wfe and app server roles clubbed together on it during the pilot phase. As a part of SharePoint infrastructure migration to a production environment and a new logical design we added 2 new app servesr and segregated the roles on i.e. wfe  and app server roles inthe new environment.

The requirement was host to central administration from app server and somehow the port was changed automatically while doing so. And it didn’t allow us to re-run product configuration wizard as the ports were different.

Got this error: Failed to register SharePoint services.  An exception of type System.UriFormatException was thrown.  Additional exception information: Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed.
System.UriFormatException: Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri.CreateUri(Uri baseUri, String relativeUri, Boolean dontEscape)
   at Microsoft.SharePoint.Administration.SPSiteCollection.get_Item(String strSiteName)
   at Microsoft.SharePoint.Administration.SPAdministrationWebApplication.get_HealthRules()
   at Microsoft.SharePoint.Administration.Health.SPHealthAnalyzer.RegisterRules(Assembly assembly)
   at Microsoft.Office.InfoPath.Server.Util.HealthAnalyzerRegistration.RegisterHealthRules()
   at Microsoft.Office.InfoPath.Server.Administration.FormsService.Update()
   at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServiceInConfigDB(Boolean provisionTheServiceToo, String serviceRegistryKeyName)
   at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServices(Boolean provisionTheServicesToo)
   at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.Run()
   at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

Run the following PowerShell command and reran product config wizard and it meet the need.

Set-SPCentralAdministration -Port <port number>

Example: Set-SPCentralAdministration -Port 2222

Note:

The Set-SPCentralAdministration cmdlet blocks the following ports:
Lower than 1023
Higher than 32767
443 (SSL)