Welcome to my notes. This section is for things i pick up, when I trawl the web. Most of whats in here, is available somewhere else. Beware.. I give no guaranties for the use of the notes. As always when you find information on the web, test it all out on your test-environment before you use it on your production.


Update SharePoint groups in all webs in a SiteCollection using PowerShell

Say you have a ton of subwebs in a sitecollection. Each web have unique permissions and unique groups. You would like to update alle membergroups to have Contribute permissions, instead of Edit permissions. If you need to update all ownergroups or visitorgroups, just change the script accordingly. You do it like this: Source: http://sharepoint.stackexchange.com/questions/70071/need-to-remove-permission-level-from-a-sharepoint-group-using-powershell


Formatting dates in Itemstyle.xsl

Insert this line at the top xmlns:ddwrt=”http://schemas.microsoft.com/WebParts/v2/DataView/runtime” That will give you a header looking like this: Then use the “ddwrt:FormatDate” to show the date i various ways: <xsl:value-of select=”ddwrt:FormatDate(@dato, 1030, 3)”/> <xsl:value-of select=”ddwrt:FormatDateTime(string(@Publiceret), 1030, ‘dd. MMM. yyyy’)”/> <xsl:value-of select=”ddwrt:FormatDate(string(@Dato), 1033, 7) “/> List of all LCID’s : http://support.microsoft.com/default.aspx?id=221435 Custom date and time formats: http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx Formatflags


Create link to new folder and item actions in modal window in SharePoint 2013

Create link to “New Item” <a href=”javascript:OpenPopUpPageWithTitle(‘</site/library>/_layouts/15/Upload.aspx?List={<List-GUID>}&RootFolder=&IsDlg=1′,RefreshOnDialogClose,null,null,'<Title>’);”>Add item</a> Create link to “New Folder” <a href=”javascript:OpenPopUpPageWithTitle(‘</site/library>/Forms/Upload.aspx?RootFolder=&Type=1&IsDlg=1′,RefreshOnDialogClose,null,null,'<Title>’);” >New Folder</a>


Pop-up modal window SP2013

Simple javascript command to open the dialog modal form function OpenPopUpPage(url, callback, width, height) function OpenPopUpPageWithTitle(url, callback, width, height, title) function OpenPopUpPageWithDialogOptions(dialogOptions) DialogOptions supports: Options Property Description title A string that contains the title of the dialog. url A string that contains the URL of the page that appears in the dialog. If both url and html are specified, url takes precedence. […]


Clear SharePoint Designer Cache

It can happen that SharePoint Designers local files gets out-of-sync. For some reason hitting the update button won’t help. Easy fix: Delete the local cache by deleting the contents of these two folders: %APPDATA%\Microsoft\Web Server Extensions\Cache %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache


Import user profile pictures to SharePoint using PowerShell

Best solution to create Automatic UserProfile Import to SharePoint Create folder “ImportProfileImages” Create subfolder “ProfileImages” Create “c:\SPSolutions\ImportProfileImages\UpdateUserProfiles.ps1” with the code from SharePoint Use Cases Create “c:\SPSolutions\ImportProfileImages\RunUpdateUserProfiles.ps1” with this code: Save the files, copy images into the “ProfileImages” folder, using the useralias as filename. Rightclick “RunUpdateUserProfiles.ps1” and select “Run with PowerShell” Source: SharePoint Use Cases


Force InfoPath to open in browserview

A normal link to an InfoPath template could be /FormServerTemplates/template.xsn But in order to get pageviews in InfoPath to work in IE11, you have to add the domain in Compatibility View Settings, thus breaking the function of starting a new form in the browser, based on your template. The normal fix is to add ?clientinstalled=false […]

DateDif in SharePoint

The function for calculating the difference between two dates in a calculated column in SharePoint, without counting the weekends: =(DATEDIF([Start Date];[End Date];”D”))-INT(DATEDIF([Start Date];[End Date];”D”)/7)*2-IF((WEEKDAY([End Date])-WEEKDAY([Start Date]))<0;2;0)+1