Missing user profile picture after updating mysite host URL in SharePoint 2013

29. April 2015 02:55 by Rashid Aziz in Sharepoint blogs  //  Tags: , ,   //   Comments
Recently I had to change mysite host URL in one of our environment. After I update my site hots URL and ran full user profile sync. Everything was working fine until I noticed that user images are not appearing inside user profiles. I have started looking into the issue and done the following steps to figure out the problem I have checked the user profile “Picture” property to make sure that It is mapped to “PhotoThumbnail” property of active directory Then I have checked that the Farm account have permissions on User profiles Using the farm account I have ran the photo import command again  Update-SPProfilePhotoStore –MySiteHostLocation http://mysiteHostUrl –CreateThumbnailsForImportedPhotos $true With help of miisclient.exe I have confirmend that the picture property is pull the binary information from active directory.  I then went to my profile and right click on the “PictureURL” and selected “Properties” option which open up the “Properties” popup window. Suddenly I realised that the URL of my user profile picture is still pointing to the old my site.    I have copied the above picture URL in the browser, updated the “mysite” host URL to new one and hit enter. I was managed to see my profile picture as below.   At last I managed to find the issue. Now it’s time to fix it. So I wrote below PowerShell command to update all user profile picture properties URL. $mySiteNewHostURL = "http://NewMySiteHostURL" $mySiteOldHostURL = "http://OldMySiteHostURL" $mySite = Get-SPSite $mySiteNewHostUrl $SPServiceContext = Get-SPServiceContext $mySite $userProfileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($SPServiceContext) $userProfiles = $userProfileManager.GetEnumerator() foreach ($userProfile in $userProfiles) { #check if the picture property contain image URL, then replace it with new my site host URL if ($userProfile["PictureURL"] -ne '') { $oldImageUrl = $userProfile["PictureURL"].toString() $newImageUrl = $oldImageUrl -Replace $mySiteOldHostURL, $mySiteNewHostURL write-host "Old Image Link = " $oldImageUrl " --> New Image Link = " $newImageUrl $userProfile["PictureURL"].Value = $newImageUrl $userProfile.Commit() } } After I ran above PowerShell script, I was able to see  picture inside my user profile as below. Happy coding 

Create Managed Property from Crawl Property in SharePoint 2013 Search via PowerShell

13. March 2015 08:32 by Rashid Aziz in Sharepoint blogs  //  Tags: ,   //   Comments
I have some custom properties in User Profile. I needed to create managed properties in SharePoint 2013 from custom user profile Crawl properties. I really don’t like doing things manually using SharePoint 2013 central administration site because then I have to recreate these properties on all different environments manually. So here is the script which will do the magic User profile property name: City  Crawl property display name: People:City Crawl property full name: urn:schemas-microsoft-com:sharepoint:portal:profile:City  You can get the crawl property full name from central admin UI (Click on “search schema” link from search administration page  Click “Crawled Properties” link Search for your property, once it appear in result, click on it. Crawl property detail page will open and will display the “Property Name” something like “urn:schemas-microsoft-com:sharepoint:portal:profile:City”)  // Get the search service application $searchapp = Get-SPEnterpriseSearchServiceApplication // create base managed property $managedProperty_City= New-SPEnterpriseSearchMetadataManagedProperty -Name "City" -SearchApplication $searchapp -Type 1 -Queryable $true -Retrievable $true -FullTextQueriable $true //Set “Refineable” and “Sortable” properties to true for this newly created managed property, by default these values will be set to false. You can skip this step if you don’t want to set the values to true $managedProperty_City.Refinable=$true $managedProperty_City.Sortable=$true $managedProperty_City.Update() //Get the crawl property which already exist and map it to the newly created managed property $crawlProperty_City= Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Limit 1 -Name "urn:schemas-microsoft-com:sharepoint:portal:profile:City" New-SPEnterpriseSearchMetadataMapping -SearchApplication $searchapp -ManagedProperty $managedProperty_City -CrawledProperty $crawlProperty_City Once you run these command, go to search schema page and search for the new managed property “City”. You should see the following result   Reference to get parameters detail: https://technet.microsoft.com/en-us/library/ff608089.aspx   

Create reusable content in InfoPath 2010

11. April 2012 04:04 by Rashid Aziz in Sharepoint blogs  //  Tags: ,   //   Comments
 I had a requirement in past where I need to create an InfoPath form which will be reusable for other custom solutions. I have decided to create a re-useable template in InfoPath 2010. I think it’s worth showing the steps. I have created employee info form which was going to be used again several times. So, I have created the form by drag and drop contents to the pane and the end result are look like this. Once the form is ready follow these steps Steps: Now go to file and click “Save as” link. Give new template a name and save it on local disk. Now from the controls section of the ribbon, click “Expand all controls” and then click “Add or Remove Custom Controls”. A new window will appear, now click on “Add” and follow the wizard by selecting template part and browse to the location where you saved the template earlier. Now your custom control is successfully added. Create now form using custom control Close the InfoPath 2010 tool and re open, create new solution and select blank form template. From the control menu select employee info control (control created in the first section) and the form will appear instantly. Now you can do the changes if want and save it. It is very important that you create re-useable contents to save development time and efforts. J

Change authentication mode in SharePoint 2010

 In the following article I will explain how to change SharePoint 2010 authentication mode. In the following example I will change authentication provider of SharePoint 2010 web application from windows authentication to claim base authentication. To do this you need to user SharePoint 2010 management shell Go to start menu > All programmers > SharePoint 2010 products > SharePoint 2010 management shell Type and execute the following command $WebAppName = “http://eblogin.com” $account = “SPdomain\ebloginAdmin” $wa = get-SPWebApplication $WebAppName Set-SPwebApplication $wa –AuthenticationProvider (New-SPAuthenticationProvider) –Zone Default A confirmation message will appear, type "Y" and press enter Now check the authentication provider from central admin. It should show "claims based authentication".

Potentially excessive number of SPRequest objects, SharePoint error

26. March 2012 06:45 by Rashid Aziz in Sharepoint blogs  //  Tags: , ,   //   Comments
I got this error in ULS log file while using one SharePoint application which was developed by third party. I have checked the code and it was disposing the SP objects correctly. The site was running really slow, and it takes about 40 seconds to load the home page. Site structure: Our application has 5 sites under a site collection and about 500 sub sites underneath those 5 sites. Reason of error: The “show subsites” option in navigation setting was checked, so when the page loads it also load 5 sites in navigation menu and all 500 sub sites links as a dropdown link menu. The navigation menu is shipped with SharePoint product, the way it is designed that it use SP Request object to build each navigation link and doesn’t dispose those object automatically (Reason: if the page do refresh, it does not need to re-create all object again) Resolution: Go to site collection home page Click site action> site settings Click “Navigation” link under “Look and Feel” section Uncheck “Show sub sites” under “global navigation” and “current navigation” as shown below If you need that navigation link for all sub sites should be available for user, think about other ways to getting this functionality (e.g. custom navigation), or reconsider your application structure. Results: After doing the above changes, I did not see any log saying “Potentially excessive number of SPRequest objects“. Also site performance increased dramatically as the home page loads in 4 seconds. J Hope this will help.

Get SharePoint 2010 Publishing Site Page Layout Programmatically

12. January 2012 03:54 by Rashid Aziz in Sharepoint blogs  //  Tags: , ,   //   Comments
I have come across a business requirement, while implementing this I need to get publishing site page layout on sharepoint 2010 using server object model. After a little research I managed to do this, I think it is worth to share code with you guys. The code below was used to get the default page layout of a publishing web site in SharePoint 2010. private static void GetPageLayout() { using (SPSite site = new SPSite("Publishing Site Collection URL")) { using (SPWeb web = site.OpenWeb()) { PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web); PageLayout pageLayout = publishingWeb.DefaultPageLayout; Console.WriteLine("Layout Name: "+pageLayout.Name + " Site URL: " + pageLayout.ServerRelativeUrl); } } }  

SharePoint 2010 List Throttling Feature Explained

12. January 2012 03:37 by Rashid Aziz in Sharepoint blogs  //  Tags: ,   //   Comments
The List Throttling is a brand new concept in sharepoint 2010.  The concept of this functionality is to set the limit on the row of data can be retrieved from a SharePoint List at on time. This concept is same for Sharepoint document library for retrieving data. Use Case: The list throttling setting will be applied on list views created by users and queries executed by custom code. When someone runs the query to retrieve all items, the number of items returns will be determined by the throttling setting for the given list and the user rights. Throttling Settings: You can set the throttling settings via central admin. In order to go to these settings, follow this path, Central Administration > Application Management  >  Manage Web Application. Once in the Web Application List, select the web application and click General Settings > Resource throttling.

How to get list of all site owners in SharePoint web application

20. December 2011 02:27 by Rashid Aziz in Sharepoint blogs  //  Tags: , ,   //   Comments
We are implementing governance in place for our SharePoint environment, during the analysis  we need to find out who is the site owner for each site in our SharePoint web applications,  we have about 500 sites and it will be  time consuming to go to each one site settings and find the owners names. I wrote a simple stsadm command to get list of site owners and some other site related information and dump it into a text file. Open the command prompt and navigate to the following path C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN Run the following command. stsadm -o enumsites -url http://WebApplicationURL > c:\allsiteinfo.txt once the command runs successfully , go to c drive and open “allsiteinfo.txt” file. You will see result something like this. <Sites Count="2"> <Site Url="http://testweb/site1" Owner="eblogin\admin" ContentDatabase="MOSS2007DB" StorageUsedMB="36.8" StorageWarningMB="0" StorageMaxMB="0" /> <Site Url=" http://testweb/site2" Owner="eblogin\admin" SecondaryOwner="eblogin\aziz" ContentDatabase=" MOSS2007DB" StorageUsedMB="0.7" StorageWarningMB="0" StorageMaxMB="0" /> </Sites>  If you like my blog please follow me on facebook and twitter to get latest blog alerts.

How to configure PerformancePoint service in sharepoint 2010

Today I will show you how to configure PerformancePoint service in SharePoint 2010. The PerformancePoint service is integrated in sharepoint 2010 environment. The PerformancePoint service is sharepoint 2010 enterprise feature, as long as you have enterprise feature switched on the PerformancePoint service will be available. Installing PerformancePoint Service Application Make sure that you have enterprise version of SharePoint 2010 installed. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on new from top ribbon and select “PerformancePoint Service application” Provide the service app name, SQL database configuration, application pool and select security account for App Pool. Click ok, you will see the following if “PerformancePoint Service application” installed successfully. Starting the PerformancePoint service Open the SharePoint 2010 central administration go to > System Settings > Manage services on server (under Servers category) Click the start link to start “PerformancePoint Service”; you will get the following when it is started. Setting up a secure store account You cannot access the performance points unattended service account to connect to data sources without secure store account. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on the Secure Store Proxy and click Manage from the top ribbon You will get a message saying ‘Generate a new key’, Click Edit on the ribbon then say Generate a new key Setting up unattended service account Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on “PerformancePoint service application” link From setting page click on the first link “PerformancePoint Service Application Settings” In the “Unattended Service Account” section, enter the username and password for querying the data sources Activate PerformancePoint Site Collection feature Open your Business Intelligence site and navigate to Site Actions > site settings > Site Collection Features (option under “Site Collection Administration” tab) and active the “PerformancePoint Site Collection features” and shown below.    You have done all configurations, for testing the configuration Open a Performance Point “Business Intelligence Centre” site and click on “Run Dashboard Designer” button. If you have effectively created a PerformancePoint site collection, you should be able to do the followings Able to browse to the BI Centre Can launch Dashboard Designer Should be able to connect to a data source using the unattended service account

How to configure PerformancePoint service in sharepoint 2010

 Today I will show you how to configure PerformancePoint service in SharePoint 2010. The PerformancePoint service is integrated in sharepoint 2010 environment. The PerformancePoint service is sharepoint 2010 enterprise feature, as long as you have enterprise feature switched on the PerformancePoint service will be available. Installing PerformancePoint Service Application Make sure that you have enterprise version of SharePoint 2010 installed. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on new from top ribbon and select “PerformancePoint Service application” Provide the service app name, SQL database configuration, application pool and select security account for App Pool. Click ok, you will see the following if “PerformancePoint Service application” installed successfully.   Starting the PerformancePoint service Open the SharePoint 2010 central administration go to > System Settings > Manage services on server (under Servers category) Click the start link to start “ PerformancePoint Service”; you will get the following when it is started.   Setting up a secure store account You cannot access the performance points unattended service account to connect to data sources without secure store account. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on the Secure Store Proxy and click Manage from the top ribbon You will get a message saying ‘Generate a new key’, Click Edit on the ribbon then say Generate a new key Setting up unattended service account Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on “PerformancePoint service application” link From setting page click on the first link “PerformancePoint Service Application Settings” In the “Unattended Service Account” section, enter the username and password for querying the data sources   Activate PerformancePoint Site Collection feature Open your Business Intelligence site and navigate to Site Actions > site settings > Site Collection Features (option under “Site Collection Administration” tab) and active the “PerformancePoint Site Collection features” and shown below.    You have done all configurations, for testing the configuration Open a Performance Point “Business Intelligence Center” site and click on “Run Dashboard Designer” button. If you have effectively created a PerformancePoint site collection, you should be able to do the followings Able to browse to the BI Centre Can launch Dashboard Designer Should be able to connect to a data source using the unattended service account    

Stay connected

SharePoint Links

Month List