Posts

Sharepoint 2010 FAST Search: Fast Query Language lessons learned

I am currently experiencing the joys of writing FQL search queries. It has been pretty much smooth sailing after I added my Managed Properties (with  this  script) and using these references: http://msdn.microsoft.com/en-us/library/office/ff394606(v=office.14).aspx http://blogs.perficient.com/microsoft/2011/06/using-fql-to-query-fast-search-index/ However, I learned the following lessons (the hard way): 1. using 'Path' to filter by URL did not work for me. I had to use path:starts-with("http://my-url/my-site") 2. date range queries work much better when dates are set in UTC myDateField:range(2000-01-01T00:00:00Z, 2020-01-01T00:00:00Z)

SharePoint 2010 FAST Search: How do I create Managed Properties?

I have delving into the wonders of FAST Search and found this  very helpful script to create managed properties. It definitely saved my a lot of time and headaches. Thank you Ivan Josipovic . Here is a copied version of the text: function New-FASTManagedProperty([string]$Name, [string]$CrawledPropertyName, [string]$Type,[bool]$Refinement,$Sortable) { if ( (Get-PSSnapin -Name Microsoft.FASTSearch.PowerShell -ErrorAction SilentlyContinue) -eq $null ) {    Add-PsSnapin Microsoft.FASTSearch.PowerShell }     switch ($Type)     {         "Text" {$type = "1"}  #variant 31         "Integer" {$type = "2"} #variant 3         "Decimal" {$type = "5"} #variant 5         "DateTime" {$type = "6"} #variant 64         "Float" {$type = "4"} #variant 5 ?         "Binary" {$type = "3"}  #variant 11     } ...

Cntlm: No connection could be made because the target machine actively refused it 127.0.0.1:3128

Cntlm  is a great tool to create an internet proxy. I wrote about how to configure it here .  However, I recently encountered the following error message when trying to access a local REST service: No connection could be made because the target machine actively refused it 127.0.0.1:3128 The port number rang a mental bell as it was configured as the listening port for Cntlm. I deactivated Cntlm: 1. Stopped the windows service 2. Reverted the proxy settings in my browser No luck. I tried rebooting the server, but that did not resolve the problem. More investigation revealed that Application Pool account for my custom web site was caching the Cntlm connection. I connected to the machine as the Application Pool account and noticed that the proxy settings for cntlm where still there. I was able to reset the settings to resolve the problem. Alternatively, I could change the Application Pool account.

SharePoint Online: How do I set the Web.AlternateCSS property in CSOM?

The properties are only exposed in the '16' (SharePoint Online) version of the client side dlls. You will need to change your references to point to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll and C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll

C#: How do I store a secure password?

The eternal problems of encryption and data security is an ever present headache for all developers. This  post provides a great introduction to the problem. Fortunately, C# provides a very powerful Windows Data Protection API to resolve this issue. Read more about it  here  and find the sample code  here . Here is a simple extension method to achieve the required result: using System; using System.Security.Cryptography; using System.Text; namespace MyProject.Security {  public static class SecurityExtensions     {         private const DataProtectionScope Scope = DataProtectionScope.CurrentUser;         static readonly byte[] AdditionalEntropy = { 9, 8, 7, 6, 5, 4, 3, 2, 1 };         public static string Encrypt(this string plainText)         {             if (plainText == null) throw new ArgumentNullException("plainText"...

C#: How do I generate a SecureString password?

There is a simple function to generate a secure string password:             public static SecureString StringToSecure(string password)             {                 var secure = new SecureString();                 foreach (char c in password)                 {                     secure.AppendChar(c);                 }                 return secure;             }

SharePoint Online: How do I brand my Sites, Subsites and OneDrive for Business Site?

The patterns for applying branding during site creation have changed, but fortunately, the Patterns and Practices team have provided some excellent guidance on how to resolve some common issues. Here are some of the links I have found very useful: Async site collection creation: https://github.com/OfficeDev/PnP/tree/master/Samples/Provisioning.Cloud.Async Sub site creation app: https://github.com/OfficeDev/PnP/tree/master/Samples/Provisioning.SubSiteCreationApp OneDrive for Business: https://github.com/OfficeDev/PnP/tree/master/Solutions/Provisioning.OneDrive