Bitlocker: how recover the recovery key


my company requires me to use BitLocker on my computer hard-disk.

Today I have discovered that after Windows updates, it can request a recover key.

So save it for future requests, it's possible to recover it, for an already BitLocked drive, using the following command from an administrative command line (Windows key, type "Command Prompt", right click, "Run as administrator"):

   manage-bde -protectors c: -get

Where C: is the drive whose key you want to recover.

SharePoint 2013: Minimal Download Strategy requirements

To ensure that MDS (Minimal Download Strategy) continues to work after deployment of custom solution, these have to be done following the rules described in Modify SharePoint components for MDS.

In short they are:

  • include your content in SharePoint:AjaxDelta control (probably already done in the master page, but worth to check)
  • include css with SharePoint:CssLink and SharePoint:CssRegistration
  • include JavaScript with SharePoint:ScriptLink
  • include inline JavaScript code in SharePoint:ScriptBlock
  • mark your assembly with
    [assembly: Microsoft.SharePoint.WebControls.MdsCompliantAttribute(IsCompliant = true)]
  • mark your controls and web parts with:
    [Microsoft.SharePoint.WebControls.MdsCompliantAttribute(IsCompliant = true)]

In addition to that:

  • ensure the JavaScript file names don't contain '-' characters, because the file name is used as an identifier by init.js

SharePoint 2013: how create host named site collection in C#

In C# you can create a hosted named site collection in C# using the method SPSiteCollection.Add in the overload reported in the link itself.

The two options (with PowerShell too) are described in Host-Named Site Collections (Provisioning by Code and in Specific Content Database).

Considerations about the rights needed from the user (eventually the app pool user with RunWith ElevatedPrivileges) to create site collection can be found in Custom SharePoint 2007 Site Collection Creation Page.

SharePoint: workflow performance

In SharePoint, there can be multiple factors that can affect workflow performance:

  • having dedicated history list and task lists, for each workflow
  • making sure that in both history lists and task lists there are maximum 2,000 items per folder (eventually create a folder structure);
  • respect the boundary of maximum 8k bytes for metadata storage;
  • keep ULS log file sizes small

Some interesting links are:

SharePoint 2010: access with Safari in iOS 8

Because of a problem in the OOTB browser definitions in .NET 2, carried up to .NET 3.5, iPhone with iOS 8 are not correctly recognized as mobile devices in SharePoint 2010.

The problem is described in iOS 8 / Safari 8 not working with ASP.NET AJAX-Extensions, but the solution in that article is not complete, as it fixes the JavaScript issue but not the mobile capabilities.

So I have merged that solution with the iPhone capabilities in the OOTB browsers definitions, getting the content of the new file that you can download here: iOS8.browser

SharePoint 2010: customizing the view behind a XsltListViewWebPart

In SharePoint Designer 2010, trying to modify the view behind a XsltListViewWebPart can seem to be ineffective.

The problem is that even after saving the page, the web part is deserialized and it contains the view inside it; when deserializing the web part before saving, the old copy of the view is retrieved, so in the end the view saved in the page seems to be unchanged.

How can you solve this? Simply creating a view in the underlying list, making the web part to use this view, and then delete the view (because not used anymore, the view is now serialized with the web part).

FYI this issue is described in:

  • XLV Bug: View settings lost on saved XSLT List View Web Part: here there is a small error, in the end it says modifying the view works in SharePoint Designer, but it is only because the page is new. Updating the page (and not creating it) doesn't update the underlying view.
  • ListViewWebPart & SPView – two sides of the same coin: this post says a hidden view is created. In my case, trying to modify the view calling the modifyView page and tricking the ViewID query string parameter with the ID in the view in my XsltListViewWebPart didn't work.
    This is why I create a normal (not hidden) view to be associated to the web part (and for cleanness, at the end this temporary view can be deleted).

Migrating applications from Windows 2003 to Windows 2008

When migrating an application from Windows 2003 to Windows 2008, the major concerns are around migrating from IIS 6 to IIS 7.

For Classic ASP applications, the settings can be taken from Moving asp Web site from IIS 6 to IIS 7.5 on Windows 2008 R2:

  • Configure the App Pool ".Net Framework version" to use "No Managed Code"
  • Set the "Managed pipeline mode" to "Classic"
  • Set "Enable 32 bit Applications" to true, in the "Advanced Settings"
  • Set the "Identity" to "Network Service", in the "Advanced Settings"
In case of errors, to help debugging you can temporarily enable:
  • In “Debugging Properties”, set "Send Errors to Browser" to True
  • In Internet Explorer, in “Internet Options” turn off “Show friendly HTTP error messages”

For .NET applications, the considerations are:
  • Maintain the Application Pool in the old Classic Mode, or convert it to the new Integrated Mode
    The process is impacted above all if HttpModules and HttpHandlers are used, and the process is described in Moving an ASP.NET Application from IIS 6.0 to IIS 7.0.
    In addition, the automated tool "APPCMD.EXE migrate config " can bed used. It is described in ASP.NET Integration with IIS 7.
  • If you are moving from an original 32 bit to 64 bit environments:
    • if the application is compiled for 32 bit mode, it is enough to set "Enable 32-Bit Applications" property to true in the Application Pool settings
    • If it is compiled for "Any CPU" you may want to try to run in in 64 bit mode. If it has not dependencies on 32 bit resources (i.e. assemblies deployed in the 32 bit GAC), it should run without any problem
    • If it is compiled for "Any CPU" and you need to run it in 32 bit mode on a 64 bit system, you can try to force its "bit-ness" using the CorFlags utility. The only risk is that this solution changes the assembly header, so it is not applicable with signed assemblies
    • If it is compiled for "Any CPU" and you need to run it in 32 bit mode on a 64 bit system and the assembly is digitally signed, you need to recompile the sources. Here you have two latest choices:
      • recompile forcing 32 bit mode
      • or better remove the dependency on the 32 bit resource so that the application can be run in 64 bit