Monday, April 21, 2014

SharePoint Designer: Conditional Formatting using a Sum Calculation

Just a quick tip I wanted to pass along --

In SharePoint Designer, if you have a need to apply conditional formatting to cells in a List column based on the value of a sum calculation in another cell, follow these steps:

1.  In Design view, click the td.ms-vb tag to select the entire cell that needs conditional formatting, select Conditional Formatting in the ribbon, and choose the Format Selection option. In my example below, the cell that I selected is in the Cost Score column.

2.  Click the Advanced button in the Condition Criteria dialog box.

3. For the XPath expression, ensure you include the ../Row in the sum calculation. In my example below, I am applying conditional formatting to each cell if its Cost Score value is less than the average of all cells in the Cost Score column.



4. Select OK and Set Style as you desire.

Hope this helps!

Wednesday, April 9, 2014

Automating User Profile Photo Import in SharePoint 2013

To automate the User Profile Photo Import process in SharePoint 2013, please use the following sequence.

Prerequisites: User photos must be added to Active Directory and the thumbnailPhoto attribute must be mapped to the Picture property in the User Profile Service Application.

1) User Profile Incremental Synchronization. In the User Profile Service Application, select Configure Synchronization Timer Job. Define a recurring schedule. I scheduled mine to run Daily at 10:00am.

2) Create and schedule a PowerShell script for running Update-SPProfilePhotoStore.

- On one of the application servers in the farm, open Notepad. Copy and paste the following and save it to a desired location as PhotoImport.ps1.



- Open Task Scheduler on the server. Select to Create Task.

General tab:




Triggers tab: (NOTE: Ensure the time is scheduled after the User Profile Incremental Synchronization schedule above, and ensure you schedule enough time for the User Profile Incremental Synchronization task to complete. 30 minutes should be sufficient.)







Actions tab:








Program/script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add arguments (optional): -psconsolefile "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\psconsole.psc1" -command "D:\Scripts\PhotoImport.ps1" 

- Leave the defaults for the Conditions, Settings, and History tabs. Select OK and type in the logged on user password when prompted.

3)  Incremental Crawl of People Content Source. In the Search Service Application, Edit the Content Source that contains the people address (sps3://mysiteurl). Create an Incremental Crawl schedule as needed. Ensure the time is scheduled after the scheduled task in step 2 above.





Each time the automated 3 step process above is run, it will update the photos in each user’s profile page and in the People search results.