Posts

How to get User ID by Email in MS Flow (Power Automate) SharePoint

Image
Its pretty straight forward when you know how to do. Going straight to the point. Create a new MS Flow and name it whatever you want. Create Get Items action. and fill the Site Adress, list name etc according to your environment. I am renaming my action to GetUserIDByEmail. Initialize a Variable and set its value to expression as mentioned below. Save and run the Flow. Here is the schema of the returned JSON. { "d" :{ "__metadata" :{ }, "Alerts" :{ }, "Groups" :{ }, "Id" : 280 , "IsHiddenInUI" : false , "LoginName" : "i:0#.f|membership|someone@example.com" , "Title" : "Someone Name" , "PrincipalType" : 1 , "Email" : "someone@exmaple.com" , "Expiration" : "" , "IsEmailAuthenticationGuestUser" : false , "IsShareByEmailGuestUser" : false , "IsSiteAdmin" : false ,...

Sort Custom Site Templates Alphabetically in SharePoint 2013

Image
Custom Site Templates are really useful in SharePoint when you have to create sites using same settings, objects, content and look & feel. However there are couple of functionalities that should be already implemented in SharePoint but somehow they are not. We have to code for them mostly. We generally create custom site templates in SharePoint and they show up in the Custom tab. However, working on a recent project we got a request from customer that the custom site templates are not in sort order in SharePoint 2013 which gives an ugly looks to end users for creating sites. There is no Out Of the Box solution provided by Microsoft for this so we had to write some custom code. We have created a custom Site Collection level feature which just sort the custom site templates in SharePoint 2013 create new web page. Here is how it looked Before and After the feature implementation. Before: After: Unfortunately i can't share the complete code of th...

DateTime Picker not working with site names which contains apostrophe ' in SharePoint 2013

Image
I have noticed that some of the sites in my SharePoint 2013 farm which contains an Apostrophe ( ' ) in their name works fine except their DateTime Picker for any of the custom list. (The OOTB Calendar type list just works fine.) If you create a custom list and add a DateTime type column in that list, in the NewForm.aspx the DateTime picker won't dropdown to select dates if the site has an Apostrophe ( ' ) in its name. I have a site below in SharePoint 2013 (i have a little branding so don't get confused) where i created a simple custom list. I clicked the Calendar icon but no dropdown appeared. Change the name of the site from Site Settings and removed the Apostrophe ' character. Before After Tried to browse the site again and the clicked on Calendar icon again in the same form. It worked... :) Its Microsoft kind'a thing and till now i haven't heard that Microsoft noticed this issue and released any patch. ...

PowerShell Script : Mount Multiple Content Databases at once with SharePoint

Image
Below is the code that you can use to mount multiple content databases with SharePoint (2010 or 2013 or 2016). Put all of the content databases names in DB.txt file and run the script. 1. Create text file with name “DB.txt” in the same directory where script file is present. Write database names in “DB” file.  Make it sure each name should be in new line and write End Point at the end as shown below. 2. Open SharePoint 2013 Management Shell 3. Change directory path to path where script file is saved. Then type ./MountSPContentDB.ps1 and press enter key. (Copy the script in a file and name it MountSPContentDB.ps1)  Provide web application url and press enter key. Provide SqlServer name and instance.  4. Result  You can track the complete log file (named MountSPContentDB -current date and time) which you can find in the same directory where your script file is located.  Script: $currentTime = G...

Components that could break after SharePoint upgrade

Although you can predict most of the stuff that could go wrong after a SharePoint upgrade or migration but still there are chances that you miss something. I have compiled a list of components that could break or stop working after you move to new SharePoint environment. I'll be updating this post whenever i found anything else breaking after SharePoint upgrade. I apologize for my rough formatting. :) InfoPath: Connections with external services and libraries. Connection with User Profile Service Application. When upgrading to 2013 from 2010, you need to update where fetching User Information like User Name User Friendly Name. SharePoint 2013 works on Claims Based Authentication so InfoPath 2010 Form Views may crash if you are showing view on user based. OneNote: OneNote Sync URL change OneNote not syncing Static URLs: Static URL's used in Web Pages, Always use relative URLS Connected Excel Files: Data exported in Excel files could break if URL change after mig...

Modifying SharePoint 2013 Search Service Topology All At Once

Image
Its a routine work that we have to create/configure SharePoint Service Applications and Search Service Application is one of the major service that takes time after creation for configuration. Mostly there are three tier architecture where we customize SharePoint Search Service Topology in order to make it more stable, available and quick for content processing. In SharePoint 2010 it was simple through UI but in SharePoint 2013 you can do all of this stuff using PowerShell. In my case, i have 2 APP servers, 2 WFE servers and 1 DB server. Below is the PowerShell script where you can replace your servers names only and get your Search Topology configured like my farm. Putting end result screenshot of my Search Topology. My APP01 server is the Central Administration server. Note: Make sure your Search Service Application has been started on all target servers. You can use below command for each server to start the service. $ssa = Get-SPEnterpriseSearchServiceApp...

Find attached Workflows to a list in SharePoint 2013 using PowerShell

Image
This Script will iterate through all the provided Site Collections and export the attached Workflows with a list in a CSV file. It will also generate a log file that contains the script execution logs. It will export the following items. 1. Site URL 2. Web URL 3. List Name 4. Attached Workflows Count 1.Text file containing database names Create text file with name “DB.txt” in the same directory where script file is present. Write database names in “DB” file.  Make it sure each name should be in new line and write End Point at the end as shown below. 2.Open SharePoint 2013 Management Shell 3.Change directory path Then type ./ WorkflowFinder.ps1 and press enter key. 3. Results 2.        Result will be saved in “WorkflowFinder.csv” file which you can find in the same directory where your script file is located. You can also track the complete log file (named WorkflowFinder -current da...