Pages

Tuesday, May 7, 2013

Redirect to new person.aspx page from People search results

My site has build in page called person.aspx, which is redirected from people search results on clicking person name or image in people results.

But suppose if you want to redirect to another page, let say new-person.aspx, then you need to customize redirection url in people core results.

To redirect user to new-person.aspx follow this steps


  •  Go to People Search results page.
  •  Edit People Search core results web part.
  •  Under Display Properties, uncheck "Use Localization Visualization"
  •  Click "XML Editor.."
  •  Copy content to text editor( word or notepad ++)
  •  Search for text " 
    "
  • Modify href property  of a tag under div.
  • $url variable contains redirect url, which redirects to person.aspx
As sharePoint 2010 supports XSLT 1.0 , you cannot use replace function which is part of XSLT 2.0

But here we can make use of other xslt functions such as concate,substring-before and substring-after

Replace this statement href="{ddwrt:EnsureAllowedProtocol(string($url))}" with

href="{ddwrt:EnsureAllowedProtocol(concat(concat(substring-before($url,'Person.aspx'),'new-person.aspx'),(substring-after($url,'Person.aspx'))))}"




  • After modification copy content to XML Editor pane, 
  • Hit apply and save.
  • Refresh page

Now on clicking user picture in people search results, it will redirect to new-person.aspx

Happy Coding !

Thursday, May 2, 2013

BCS application throwing "There are no addresses available for this application"


Today morning I created brand new BCS application.  Creation process went well,  and it  was created successfully. Soon after it, I went back and clicked "BCS Service"  from manage service applications, and got  following error.




The problem occurs because Business Data Connectivity Service  is stopped. To start BCS Service

Go to Central Administration -->  Application Management --> Under Service Applications
Click Manage services on server. Start business data connectivity service.

Perform iis reset.

And it started working.

I hope it helps !

Friday, September 7, 2012

Powershell error : Execution of script is disabled on system

Got below error while executing powershell script on Windows 7 x64 machine


It can be easily identified from error that i have to enable script execution.

To enable it, execute following command in powershell :

PS > Set-ExecutionPolicy -ExecutionPolicy UnRestried

After hitting Enter it will asked for confirmation. Press 'Y' and enter .

Now powershell script execution on system is enabled.

Sunday, September 2, 2012

SharePoint 2013 Managed Account Error - Requested registry access is not allowed


This is first time I came across error saying "Requested registry access is not allowed".  Error was thrown while creating managed account for User profile application.  As every SharePoint error is tied up with correlation id, was the closed to get clue about potential problem. Check below snapshot of error thrown.














Found one entry from all other  related to the issue by matching correlation id, which was signaling issue due to authentication.

Application error when access /_admin/registeraccount.aspx, Error=Requested registry access is not allowed.   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)     at Microsoft.SharePoint.Administration.SPCredentialManager.GetMasterKey(SPFarm farm)     at Microsoft.SharePoint.Administration.SPCredentialManager.GetFarmEncryptionKey(SPFarm farm)     at Microsoft.SharePoint.Administration.SPCredentialManager.EncryptWithMasterKey(SecureString sstrPassphrase)     at Microsoft.SharePoint.Administration.SPEncryptedString.SetSecureStringValue(SecureString sstrValue)     at Microsoft.SharePoint.Administration.SPManagedAccount.Update()     at Microsoft.SharePoint.WebControls.RegisterAccountControl.BtnSubmit_Click(Object sender, EventArgs args)     at System.Web.UI.WebControls....        208dc99b-07aa-10f5-0000-0a031a12d122

After searching on the same on web, I was able to find that there is some registry entry which do not have access  rights.  Which means that while creating managed account it uses information from this registry, but as user under which managed account was created do not have access to this registy.

One can open registry using regedit command. In Registery editor go to 

HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\15\Secure\FarmAdmin

Check central  administration app pool Identity  have permission on FarmAdmin. Permission can be check on right clicking FarmAdmin --> Permissions.

After adding admin app  pool identity and giving full rights , I was able to create managed account.


Note : Wrong changes in registry might affect your system, so make yourself 100% sure before doing any changes.