Wednesday, 27 February 2013

How to enable write caching on domain controller


Once a server is promoted to a DC, Windows 2008 R2 in my case, write cache is disabled by default. You can try to enable it, but it will revert back to disabled. This is default behavior to protect AD Database.
You should not "hack" to enable it on Production Server, but what if you really want it on Dev/Test environment. Some workarounds

Manual  Enabling or Disabling the Disk Write Caching
  • Right-click My Computer , and then click Properties .
  • Click the Hardware tab.
  • Click Device Manager .
  • Click the plus sign (+) next to the Disk Drives branch to expand it.
  • Right-click the drive on which you want to enable or disable disk write caching, and then click Properties .
  • Click the Disk Properties tab.
  • Click to select or clear the Write Cache Enabled check box as appropriate.
  • Click OK .
Dskcache.exe Utility
Get Dskcache.exe from http://support.microsoft.com/?id=811392 to enable Write Cache on start up script

c:\dskcache.exe +w
exit
Start > gpedit.msc then go to
Local Computer Policy\Computer Configuration\Windows Settings\Scripts

Registry hack

Path: HKLM\System\CurrentControlSet\Services\NTDS\Parameters
Value: "DSA Heuristics"
Type: REG_SZ
Setting this to "1" (Note: the type MUST be a string type) prevents AD service from disabling write cache.

Friday, 22 February 2013

Tuesday, 29 January 2013

Claims to Windows Token Service - Unexpected Claims Authentication Exception

The following error is found in SharePoint 2010 ULS Log / Developer Dashboard
Exception Message: Claims to Windows Token Service - Unexpected Claims Authentication Exception

Details: Claims Authentication Unexpected g220 No windows identity for [domain]\[user] Call stack:
at Microsoft.SharePoint.Administration.SPFarm.CurrentClaimsUserIsBoxAdministrator(IClaimsIdentity identity) at Microsoft.SharePoint.Administration.SPFarm.CurrentUserIsBoxAdministrator() at Microsoft.SharePoint.Administration.SPWebApplication.CurrentUserIgnoreThrottle() at Microsoft.SharePoint.SPManagedCodeInterop.CanCurrentUserIgnoreThrottle(Guid siteId) at Microsoft.SharePoint.Library.SPRequestInternalClass.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns) at Microsoft.SharePoint.Library.SPRequest.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns) at Microsoft.SharePoint.SPWeb.GetSiteData(SPSiteDataQuery query) at SiteDataQuery.VisualWebPart1.VisualWebPart1UserControl.GetDataUsingContentType(UInt32 rowLimit, SPWeb web) at SiteDataQuery.VisualWebPart1.VisualWebPart1UserControl.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.AddedControl(Control control, Int32 index) at SiteDataQuery.VisualWebPart1.VisualWebPart1.CreateChildControls()
Pre-conditions: 

  • SharePoint Web Application uses Claims-based Authentication 
  • Current log in user is not added to any group of the current server (Windows Identity Not Found) 
  • Claims to Windows Token Service is Stopped in the Central Administration Site. 


Resolution: Turn on Claims to Windows Token Service in Central Administration Site

Root Cause: unknown yet. Trying to get some information/documentation from Microsoft.

Possible cause: It is the way SharePoint works internally. The web part code tries to get SharePoint site data (e.g SPSiteDataQuery), SharePoint tries to determine if List View Threshold is reached / CanCurrentUserIgnoreThrottle. Then the exception is thrown if SPFarm could not determine / convert Windows token to Claims token. Note that the web part still return enough data. Just some annoy exceptions in ULS/Developer dashboard as above