Posts

Showing posts from August, 2016

SharePoint 2013: Get UserProfile Properties with REST API

1) Get all properties of current user: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties 2) Get single property of current user: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PictureUrl OR http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl 3) Get Multiple Properties for the current user: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,AccountName 4) Get all properties of Specific User: For Office 365/SharePoint Online: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='user name' For SharePoint 2013 On-Premise: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='domain\username' 5) Get Specific UserProfile Property of Specific User: For Office 365/SharePoint Online: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,

SharePoint 2013: Working with User Profiles & JavaScript CSOM

<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.0.min.js"></script> <script src="/_layouts/15/SP.Runtime.js"></script> <script src="/_layouts/15/SP.js"></script> <script src="/_layouts/15/SP.UserProfiles.js"></script> 1. Get User Properties <Script type="text/javascript"> (function($){   $(document).ready(function(){          SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js');   });   var userProfileProperties = [];      function loadUserData(){     var clientContext = new SP.ClientContext.get_current();           var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);              var profilePropertyNames = ["PreferredName","PictureURL"];                var targetUser = "domain\\username";        var userProfilePropertiesForUser =

Whatz new in SP 2016

http://en.share-gate.com/blog/whats-new-in-sharepoint-2016

Force stop and start a full crawl on content sources in SharePoint 2013 using PowerShell

Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | ForEach-Object {     if ($_.CrawlStatus -ne "Idle")     {         Write-Host "Stopping running crawl for content source $($_.Name)..."         $_.StopCrawl()                 do { Start-Sleep -Seconds 1 }         while ($_.CrawlStatus -ne "Idle")     }         Write-Host "Starting full crawl for content source $($_.Name)..."     $_.StartFullCrawl() } For Status Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "Search Service Application" | select Name, CrawlStatus

Get SharePoint Log details using correlation Id using powershell

Get-SPLogEvent -StartTime (get-date).AddMinutes(-10) | where {$_.correlation -eq "Corr ID"} | Export-CSV "c:\Errors.csv" -notypeinformation

User Profile Sync Service stuck on ‘Starting’

Cause Farm account password was changed recently. It was only changed on application pool but was not applied globally via SharePoint CA. Resolution The password for the farm and UPA account was changed The change was made directly from the IIS manager and not from the SharePoint Central Administration Browsed to ‘CA > Security > Configure Managed accounts’ and applied the new password for the account. We granted the required permissions for the account in order to start the User Profile Synchronization Service Started the UPA Sync service successfully.