Fix for AuthManager(CommerceServer): Error reading Commerce Server administration database

The below exception is easily remedied by removing all entries that relate to Commerce Server authentication module from your web.config. You are probably not using that module. 🙂

[COMException (0x800a0cc1): AuthManager(CommerceServer): Error reading Commerce Server administration database. Check the AddressKeyName setting in the CSApp.ini file for the site and ensure that it refers to the name of a Commerce Server application that exists for the site. Site name: 'MySite' Application name: 'MySite' Auth resource property: 's_SecureHostname' HRESULT: 0x800A0CC1]

SharePoint 2007 listitem manager

For a while now I’ve tried to find a tool that would allow me to export a SharePoint 2007 list to Excel, modify the data and then import it to another system. In my case I wanted to move data between our many testing environments and modify it easily and in bulk.

Having failed to find a good solution for this I’ve created a tool. It’s published on GitHub and named SharePoint listitem manager. The current version is v0.11 which does the basics (export and import), but I hope to expand and improve the tool as time goes.

At the moment I don’t provide any binaries to download. Feel free to clone the repo and build the solution yourself. The tool is totally untested so I don’t want to release it as a binary quite yet.

“No authority could be contacted for authentication” in SharePoint farm

Just ran into this when trying to access SharePoint 3.0 Central Administration on for my MOSS farm.

Turns out the AD somehow got corrupted when I restarted the servers in the farm. The solution was to remove the servers from the domain, delete the computer accounts (using the dsa.msc MMC plugin) and then re-add the servers and restart them…

Great way to spend a couple of night hours! 🙂

Getting current page URL (or it’s parts) in C#

Here is an easy reference for how to get different parts of an URL in C#.

I’ve color-coded the example URL below for easier matching with the values of the properties of the HttpRequest.

URL used for this example:
http://localhost:12345/site/page.aspx?q1=1&q2=2

Value of HttpContext.Current.Request.Url.Host
localhost

Value of HttpContext.Current.Request.Url.Authority
localhost:12345

Value of HttpContext.Current.Request.Url.AbsolutePath
/site/page.aspx

Value of HttpContext.Current.Request.ApplicationPath
/site

Value of HttpContext.Current.Request.Url.AbsoluteUri
http://localhost:12345/site/page.aspx?q1=1&q2=2

Value of HttpContext.Current.Request.RawUrl
/site/page.aspx?q1=1&q2=2

Value of HttpContext.Current.Request.Url.PathAndQuery
/site/page.aspx?q1=1&q2=2

“File Not Found” error in SharePoint 2007 site manager

When trying to edit a list from site manager in my SharePoint 2007 environment I got the following error:

File Not Found. 
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) 
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) 
at System.Reflection.Assembly.Load(String assemblyString) 
at System.Web.Configuration.CompilationSection.LoadAssembly(String assemblyName, Boolean throwOnFail) 
at System.Web.UI.TemplateParser.AddAssemblyDependency(String assemblyName, Boolean addDependentAssemblies)at System.Web.UI.TemplateParser.ProcessDirective(String directiveName, IDictionary directive) 
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)

Using the trusty old Process Monitor I was able to trace the source of the error to MOSS not being able to load Microsoft.SharePoint.ApplicationPages.dll.

I added this dll (and Microsoft.SharePoint.ApplicationPages.Administration.dll) to GAC and did an iisreset which fixed the issue.

Locations for the dlls above:

  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\CONFIG\ADMINBIN\Microsoft.SharePoint.ApplicationPages.Administration.dll
  • C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\CONFIG\BIN\Microsoft.SharePoint.ApplicationPages.dll

Target display mode iMac -> MacBook Pro 2011 with Thunderbolt

This was not as easy as it seemed. A checklist to get target display mode working:

  1. Make sure both your iMac and your Macbook Pro are equipped with Thunderbolt. It only works Thunderbolt -> Thunderbolt or Display port -> Display port, no mix allowed.
  2. Make sure you are using a Thunderbolt cable, display port cables won’t work for newer models equipped with TB.
  3. Make sure the cable on iMac’s side is turned the right way (you can insert it upside down into the iMac but not into Macbook Pro!).
  4. Make sure you are using a Mac keyboard, a PC keyboard will not work, even if remapped. Use the small Bluetooth keyboard provided with your iMac.
  5. Press Command-F2 on your iMac’s keyboard. If your function keys are not used as “standard function keys” (can be set in Settings / Keyboard) – use Command-Fn-F2.

When in target display mode you can adjust the brightness of your iMac’s screen by pressing F1/F2 on the iMac’s keyboard. To go back to regular mode press Command-F2 again.

Good luck!

Fix for VPN connections on Mac OSX using SonicWall NetExtender (pppd)

Seems like Apple broke pppd with one of the latest patches to OSX. My SonicWALL NetExtender stopped connecting unless run as root. The error i got was:

FATAL: An immediately fatal error of some kind occurred, such as an essential system call failing, or running out of virtual memory.

After some detective work I fixed this by changing permissions as follows:

sudo chmod a+s /usr/sbin/pppd
sudo chmod -R a+w /etc/ppp

Hope this helps someone. 😉

Aborting import operations in Commerce Server 2007

Today, my Biztalk ran wild and initiated a bunch of Commerce Server catalog import operations. While trying to find a way to abort all of those I came across the CatalogStatus table in the product catalog database.

According to MSDN this table contains the status of operations in the catalog system. Among other things you can monitor the PercentComplete column for operation progress.

Turns out you can also abort any operation by setting AbortRequested to 1, so the SQL below did the work for me.

UPDATE CatalogStatus
SET AbortRequested = 1
WHERE StartDate =  GETDATE()-1