Access Denied due to invalid credentials in IIS7

I’ve been having issues with a few ASP.Net websites that we’re moving to IIS7 at work.  It didn’t happen to app of them, but to some it would prompt for network credentials, then throw an HTTP 401.1 “Access Denied Due To Invalid Credentials” error.  We’d hunt around for solutions and never find anything that worked.  Finally I tripped over the answer this morning:

Open the website in IIS, and under the IIS header double-click on Authentication to open.  Click and select Windows Authentication, then click “Providers” on the right under Actions.  Make sure NTLM is above Negotiate and click OK.

Problem solved!  Hope this helps someone!

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

_controltemplates/TaxonomyPicker.ascx failed in SP2010

Our SharePoint 2010 started crying late last Friday, of course right when I wanted to leave, and first thing this morning I took a look at the server and found the following errors:

Load control template file /_controltemplates/TaxonomyPicker.ascx failed…

Fortunately, I’m not the only one who seems to have had this problem pop out of the blue.  I found a solution fairly quickly here.  To summarize, here’s what you do:

On the server, navigate to C:program filescommon filesmicrosoft sharedweb server extensions14TEMPLATESCONTROLTEMPLATES and open TaxonomyPicker.ascx in notepad.  towards the top you will see the following line:

<%@ Control className="TaxonomyPickerControl" Language="C#" Inherits="Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker&#44;Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Change the &#44; to a comma (,), so now the element will look like this:

<%@ Control className="TaxonomyPickerControl" Language="C#" Inherits="Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker,Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Save the file.  No need to restart IIS or any web services, app pools, nothing.  Not sure why it did that, but it did, and this fixed it!

Hope this helps someone else!

UPDATE: If this doesn’t help, try renaming the file to TaxonomyPicker.ascx.broken.  Apparently the control isn’t even used and this will force the App Pool to ignore it when refreshing.

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Moving a SharePoint 2010 Web using PowerShell

One of the tasks I have at my workplace is to “migrate” SharePoint sites from one parent site to another as projects are closed out.  I wanted a solution to keep all of the business’s active project sites separate from their “archived” ones.  The problem arose when that “archive” has to happen.  You can’t just “move” a website in SP2010 (or at least, not in any way I’ve found or researched).  You can, however, export and import the site, so that’s what I did.  However, given the fact Microsoft will be moving away from STSADM in future builds of SharePoint, now was as good a time as any to start applying PowerShell.  Here’s what I came up with (save the following as a .ps1 file and run in the SharePoint 2010 Management Shell):

cls
# Prompt the user for the source project name URL fragment
#
$input = Read-Host "Enter the website (ex: http://portal/site)"
#
# Set variables
#
$sourceURL = $input
$web = Get-SPWeb $sourceURL
$web = $sourceWeb.Name
$targetURL = "http://portal/archive/"+$sourceName
$title = $web.Title
#
# Let's begin
#
Write-Host "Extracting source URL"
#
# Export the source site to the desktop
#
Export-SPWeb $sourceURL -Path "C:userspublicdocumentstemp.cmp" -Force -IncludeUserSecurity -IncludeVersions all -NoFileCompression -NoLogFile
#
# In PowerShell, we need to create the website first, then import it. This is a by-design security feature
# built into PowerShell.
#
Write-Host "Migrating site to target URL"
New-SPWeb $targetURL -Template "STS#0"
#
# Update the target title
#
$web = Get-SPWeb $targetURL
$web.Title = $title
$web.Update()
#
# Import the same site, overwriting the existing one we just made
#
Import-SPWeb $targetURL -Path "C:userspublicdocumentstemp.cmp" -UpdateVersions Overwrite -Force -IncludeUserSecurity -NoFileCompression -NoLogFile
Write-Host "Removing source site"
#
# Remove the source site
#
Remove-SPWeb $sourceURL -Confirm:$false
Write-Host "Completed"

This exported everything into a temporary location, including versioning and user security, created the target website using the default Template (STS#0 — you can substitute for whatever template you’re using, just make sure they match), then imports to the target location, overwriting everything and including original user security and versioning, and finally removes the original site.

I’m sure someone’s thought of a better or more efficient way of doing this, but this one is quick and works for me.  Hope it helps someone!

Eric

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 35 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a Sr .Net/SharePoint Developer for General Motors, and also as a consultant.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube