Posts

SharePoint: How do I get the location of the MySite url using PowerShell?

[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server"); [void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server.UserProfiles"); [void][reflection.assembly]::Loadwithpartialname("System.Web"); [void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint"); $mySiteUrl = "http://mysitecollection.com" $sc = Get-SPServiceContext($mySiteUrl) $upm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($sc) Write-Host $upm.MySiteHostUrl NOTE: If you encounter a 'Permission Denied' error, make sure that your user has 'Full Control' permissions on the User Profile Service.

SharePoint: How do I upload a file structure to a document library?

My current project uses a custom 'style library' document library. The deployment process needed to replicate the files and file structure from the disk in the target library. I used CSOM and Powershell to solve the problem. I created a 'Common' dll that contains the methods I needed: 1. CreateFolder (to create a folder structure) 2. UploadFile (to load the file).     public static class FileHelper     {         public static Folder CreateFolder(Web web, string listTitle, string fullFolderPath)         {             if (string.IsNullOrEmpty(fullFolderPath))                 throw new ArgumentNullException("fullFolderPath");             var list = web.Lists.GetByTitle(listTitle);             return CreateFolderInternal(web, list.RootFolder, fullFolderPath);         }...

JQuery DatePicker: How do I add a watermark?

A watermark is always a great way to provider a meaningful hint to a user. Using the JQuery DatePicker control, I wanted to tell the user the expected format of the date.  I added a new class called 'watermarkrequired' to the required html elements to help me identify them. I looked at several option: 1. Using the blur and focus events. $('.watermarkrequired').blur(function () { if ($(this).val().length == 0)    $(this).val(watermark).addClass('watermark'); }).focus(function () { if ($(this).val() == watermark)     $(this).val('').removeClass('watermark'); }).val(watermark).addClass('watermark'); 2. Using the 'AppendText' option of the DatePicker $( ".watermarkrequired" ).datepicker( "option", "appendText", "(yyyy-mm-dd)" ); Finally, I settled on the placeholder attribute $( ".watermarkrequired" ).attr("placeholder", "dd/mm/yyyy");

FAST Search: Failed to communicate with the WCF service

I was creating my managed properties to my FAST server (via FAST PowerShell) when I encountered this error Get-FASTSearchMetadataManagedProperty : Failed to communicate with the WCF service The resolution was pretty simple - I followed the steps in  this  link: 1. Add the user to the Windows group FASTSearchKeywordAdministrators 2. Log off the machine and log in again. 3. Problem resolved.

JQuery UI Dialog: Cannot call methods on dialog prior to initialization

My current project (using Angular JS on SharePoint 2010) requires a modal dialog window with some data passed between the different modules. We used dialog-service  from GitHub, which is a great utility for this purpose. All was great until I deployed the solution to a new environment. Suddently, my modal dialog stopped working and was complaining about 'initialization' issues. I stepped through the code and found that the initialization code was being called and  dialog.ref.is(':data(dialog)') was returning true. So what was different? To cut a long story short, the culprit was the Document ID Service (which was enabled on the new environment). It was appending text to the HTML, which was causing all the problems. Two solutions presented themselves: 1. Disable the feature (not likely) or 2. trim the appended text: if (html.indexOf('<html xmlns:') >= 0)    html = html.substring(0, html.indexOf('<html xmlns:')){ } I chose the lat...

Why are my accounts always locking/not authenticating when connecting to an old site in Windows 7?

I recently changed my password and found that all of my old connections were failing. And I was not being prompted to enter new credentials. Fortunately, the fix is pretty simple. Windows 7 has a Credential Manager (in the Control Panel) that stores all the saved information. I updated the relevant passwords and all was well with the world.

SharePoint 2010: How do I set the value multi select lookup column?

A seed data script I was writing required a multi value selection lookup column to be pre populated. Setting a single value is simple - use <Id>;#<Text> - and all is well. But how do you set multiple values? The solution is just as simple; use ;# as the delimiter between items. For example, you could set your column with the following: <ID1>;#<Text1>;#<ID2>;#<Text2> Semi-colon Hash (;#) is the delimiter of choice.