Monday, December 29, 2014

Unexpected error on add from existing site columns in Sharepoint

I recently ran into an issue with trying to ‘Add from existing site columns‘ to one of my SharePoint lists on a specific SharePoint site.
When doing so I was presented with:

——————————————————————
Error
An unexpected error has occurred.
Correlation ID: GUID
—————————————————————–
Looking up that Correlation ID in the SharePoint 2010 ULS logs I saw this error:

“Unexpected System.ArgumentException:  No two choices should have the same ID at Microsoft.SharePoint.ApplicationPages.ChoiceCompareWithDefaultGroup.Compare”

What this initially told me was there were two Site Columns in my Site that was using the same internal name, and that Site column was associated with my list which is preventing me from adding any additional columns.
By browsing to the Site Collection Site Columns (http://portal/site/_layouts/mngfield.aspx) I noticed under one of my Site Column Groups that there were two Site Columns listed with the same InternalName, Type and Source.
After verifying  that this Site Column was not being used in my List I removed one of the Site Columns from that Site Column Group.
Once I removed that Site Column I went back to my list, and was now able to ‘Add from existing site columns‘ without error.

Hopefully this helps others who have encountered the same issue.

Wednesday, November 12, 2014

The search results with %5C see more Sharepoint Bug

In our Intranet we got this nasty double encoding error that was introduced in SharePoint April 2014 CU. In July 2014 CU the problem is still there. I often hear the suggestions to update files directly in the hive (the root folder for SharePoint: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\) In that blog post it is described what the problem is and what files are affected and what code must be altered in order to get it to work (which I like). But it is also suggested to update the Search.ClientControls.js directly on the server (which I don’t like). So my advise is:
Do not mess with the SharePoint hive
Even though you have access, treat it as a black box, because
  • you don’t want to update the full file and the minified version of it on all servers and keep track of possible changes
  • you don’t want to loose Microsoft support because you have messed up the application folder
  • you want to think Cloud and Cloud-Ready. In Office 365 you’ll never get access to the hive.

What to do then?

Allright, enough said about the theory. What should we do to solve this issue? Here is my suggestion
  1. Find out how critical it is, perhaps you can wait until the next CU is released
  2. Contact Microsoft and let them fix it
  3. Find an alternative solution.

A solution without messing with the hive

To solve this particular problem, we can inject our fix into the Search.ClientControls.js on the fly using the SP.SOD framework. The problematic function is the $urlHtmlEncode. Before the April 2014 CU it looked as follows:


 function $urlHtmlEncode(str) {
   return $htmlEncode(Srch.U.ensureAllowedProtocol(str));
}
 
So now we can reset it back through our code. Just add these lines of code to a javascript file that is loaded on all pages (within a custom master page, or a custom user action):


/// @author Anatoly Mironov
SP.SOD.executeOrDelayUntilScriptLoaded(function () {
    $urlHtmlEncode = function (str) {
        return $htmlEncode(Srch.U.ensureAllowedProtocol(str));
    }
}, "Search.ClientControls.js");
 
This code will register code for resetting the problematic function and execute when Search.ClientControls.js is loaded. On pages where Search.ClientControls.js is not loaded (on the majority of the pages except the Search Center), this function will not execute.

Tuesday, October 21, 2014

SharePoint 2010 Publishing Sites and Mobile Views Authentication Issue

OPTION  1:

We recently faced an issue with our SharePoint Internet Portal. The Site was published on Internet, but when browsed on Mobile phones, especially Iphone. Whenever you browsed the portal through a mobile device, its throws the authentication window, where you need to provide user id and password.

By default, making a site in SharePoint anonymous not works for mobile users. But this is a very common requirement for Internet Facing web sites, meaning we cannot use SharePoint for Internet? As I started googling, I came to this msdn discussion which concluded same, but there should be some way. There is saying, “Where there is a will there is a way” and there is a way:).

Disable ViewFormPagesLockDown feature from your site collection, since it is by default enabled on publishing sites. Lockdown mode is a feature that you can use to secure published sites. When lockdown mode is turned on, fine-grain permissions for the limited access permission level are reduced. When this feature is enabled, it stops anonymous users accessing any of the layout pages. In case of mobile view, when auser accesses Intranet site,  SharePoint redirects the user to /_layouts/mobile/mblwp.aspx to determine the correct rendering template to be applied. Since it is an application page, LockDown mode will not let the anymous user access the page and he/she will get 401 unauthorized.

Now you know the solution for this, disable the ViewFormPagesLockDown using below powershell command, re-apply permissions (enable anonymous access) and finally recycle IIS to be on safe-side.
Disable-SPFeature -Identity "ViewFormPagesLockDown" -URL http://internet


OPTION  2:

Another workaround, which is a little less drastic, is to disable the recognition of mobile browsers only. It can be done by adding the following snippet in the system.web section of the web.config of your Web Application:

  <system.web>
<browserCaps>
  <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  <filter>isMobileDevice=false</filter>
</browserCaps>

Monday, September 8, 2014

The partial project item type does not have a value for this property

When you faced error  "The partial project item type does not have a value for this property."

Its due to
"Visual Studio is now released, so you might want to consider upgrading to RTM. It was released a while ago. This is most likely a bug in the VS2012 RC "

Solution:
Modified the "SharePointProjectItem.spdata" to  added the value SupportedTrustLevels="All"  SupportedDeploymentScopes="Web, Site"   in the <ProjectItem>.

Sunday, August 17, 2014

Attaching specific W3WP Worker Process during debugging in sharepoint

While debugging your custom code in the SharePoint instead of attaching all worker processes(w3wp.exe) this is the command to attach/identify only the current application specific w3wp process
Command to get the correct w3wp process
C:\wondows\System32\inetsrv\appcmd list wp



 
Here I have written my custom code on Sharepoint-1122 site and debugging the same. So the processor which attached to this application  is 4736(see above fig).
So attach only one process which is associated (like below) instead all
or You can directly get process id in IIS

To get list of running  worker process, Open IIS Manager ( Run > Inetmgr ), Select root level from left site navigation tree and from “Features View Panel” select “Worker Processes”
1
Click on the “Worker Processes” to get details of all worker process which are currently running as shown in below.
ProcessList
So from the above list of worker processes you can get the details of Application Pool Name, Process ID, state of worker processes along with CPU uses and memory uses.

Monday, August 11, 2014

Sharepoint Site collection backup/restore vs. site export/import with focus on running workflows, version history and auditing

Custom SharePoint solutions usually contain custom lists with custom event receivers, custom workflows, maintain version history, use auditing etc. For a site with lists that have those customization it’s important to make sure that the backup/restore process will not lose any of the running workflows, workflow tasks and their status, items version history (major and minor versions), registered audit events etc.
Regarding audit events, in fact they are saved in Audit table in the content database and site backup/restore or export/import will not affect that table but can make other changes(for example new site GUID) which will result in invalid rows in that table (one of the columns is Site ID (GUID)).
Database attach is always the best way to avoid any problems of this kind but in some cases for various reasons very frequent backup of the content database is not preferred and backup of a single site collection (SPSite) or single site (SPWeb) is required. Another reason for testing site export/import is that I’ve seen administrators using export/import for migration to another location and as a more frequently running backup plan and I was asked is it safe to do that for custom solution.

Test case:

I tested site collection backup/restore and site export/import in SharePoint 2010 (I've seen the same behaviour in SharePoint 2013 because I think there are no changes in that part but its not fully tested for 2013 as for 2010). In the site there was a document library with versioning (major and minor) enabled, auditing was enabled and there were custom workflows associated with the list. In the time of back up there were documents in minor and major version. Also some of the documents had workflows in running state. After the backup some versions from items versions history were deleted, running workflows were completed and workflows on other items were started. Also some of the documents were deleted and new documents created. After that the restore/import was performed and the restored/imported site was compared with the original state (state when the site was backed up/exported). Import of the exported site was tested by importing on the same location and also importing on another sub site.
Below are the commands for backup/restore and export/import and the results after restore/import. The focus is on running workflows, version history and registered auditing events.

Site collection backup

PowerShell command to backup a site collection
 
Backup-SPSite -Identity "site collection url" -Path "backup file path"
More information for Backup-SPSite: http://technet.microsoft.com/en-us/library/ff607901.aspx

Site collection restore

PowerShell command to restore a site collection
1
Restore-SPSite -Identity "site collection url" -Path "backup file path"
More information for Restore-SPSite: http://technet.microsoft.com/en-us/library/ff607788.aspx

Restore results:

The results are the same when restoring on the same location or another location, in the same web application or another web application.
Results:
-          The restored site collection has new site ID (GUID).
-          All items versions and workflows are restored successfully.
-          Audit events are lost. This happens because of the new site ID (GUID). This can be fixed by updating Audit table in the content database. If the site collection is restored in the same location or another location that uses the same content database then rows in Audit table should be updated by writing the new Site ID in the rows that have the old Site ID. If the restore is done on another location that uses another content database then new rows must be created in the Audit table in the new content database by reading the old audit events from the Audit table in the old content database.

Site Export

PowerShell command to export SPWeb:
1
Export-SPWeb [-Identity] "site url or GUID" -Path "backup file path"
More information for Export-SPWeb: http://technet.microsoft.com/en-us/library/ff607895.aspx
Important: Export-SPWeb does not export the running workflows.

Site import

Powershell command to import SPWeb:
1
Import-SPWeb [-Identity] "site url or GUID" -Path "backup file path"
More information for Import-SPWeb: http://technet.microsoft.com/en-us/library/ff607613.aspx

Import in the same location

If there are event receivers running custom code in the lists it’s recommended to remove all of them before import to avoid any failure caused by the event receiver logic. Depending on the logic of the event receivers import may completely fail or the imported web may have wrong items version history and other problems. After import event receivers can be added back. For removing/adding event receivers with PowerShell check one of my older posts Add, Modify or Delete List Event Receivers with PowerShell

Import results:

-          Import operation does not import the workflows (as expected, because they don’t get exported with Export-SPWeb).
-          Import does not affect the currently running workflows but import of the document versions fails for those documents with running workflow.
-          Versions are correctly imported only for document with no workflows in running state when importing.
-          Audit events are not affected by the import, so all events are retained including those registered between export and import

Import in another sub site

The following must be done before importing the exported site:
-          Create new site using the same template and same language as the exported site
-          As explained above, removing event receiver is strongly recommended

Import results:

-          All running workflows are lost
-          All custom site properties and custom item properties are lost (properties in SPWeb.Properties and SPItem.Properties hashtables)
-          All workflow associations are lost
-          Document versions are imported successfully
-          Audit events are lost
-          Workflow tasks are lost

Conclusion:

Database attach of a backed up content database is superior for custom SharePoint solutions that contain custom workflows, custom web and item properties, custom event receivers, version history etc. To avoid big content database and long backup times its better the custom solutions to be installed in a site collection that has its own content database instead of sharing one content database with other site collections. That way backup/restore space and time will stay in normal and manageable boundaries. In that case you can stick to database backup as the best backup/restore plan for highly customized and big SharePoint solution.
Site collection backup/restore is better than SPWeb export/import but not as trouble free as database backup/restore plan. The problems are caused by the new Site ID (GUID) generated. That causes lose of audit events, or more precisely additional work to correct the Audit table after the restore.
Site export/import is almost useless for custom solutions that contain custom workflows, event receivers, custom web and item properties, custom event receivers, version history etc. It has problems even if it’s used for simple sites that use only SharePoint out of the box functionality if it has lists with workflows and versioning enabled.

Import and Export Sites on SharePoint 2010 Using PowerShell

This article will show you how to import / export operation of a particular SharePoint site using Power Shell

1. On the Start menu, click All Programs.

2. Click Microsoft SharePoint 2010 Products.

3. Click SharePoint 2010 Management Shell.

4. At the Windows Power Shell command prompt type the following command:






5. You will get a Power shell command prompt like below


6. In SharePoint 2010, Power Shell command Export-SPWeb is used to export the site

7. Please see the screen shot for the Power Shell command

8. Export-SPWeb -Identity http:\\ServerName:port\Site -Path c:\\backup\Exportback.dat


9. The NoFileCompression parameter lets you specify that no file compression is performed during the export process. Using this parameter can lower resource usage up to 30% during the export process. Using this parameter will result in a backup folder being created instead of a compressed file. If you use the NoFileCompression parameter in the Export-SPWeb command, you must also use it when you import the content by using the Import-SPWeb command.

10. To import to a site you have to use Import-SPWeb command

11. The complete command is

12. Import-SPWeb -Identity http:\\ServerName:port\Site -Path c:\\backup\Exportback.dat -Force

13. I have used -force to over write the existing site in my destination

Tuesday, April 29, 2014

Configure fba in Sharepoint 2010

Configure an extranet web application for Claims based authentication using AD and Forms.  Store membership credentials in a SQL database.  Manage members through IIS Manager.

Steps
1. Configure SQL for membership store
  • Create database
  • Create SQL User
  • Add SQL user to database
2. Configure Central Admin to use SQL membership store
3. Configure Secure Store Web Service to use SQL membership store
4. Create new Web Application for extranet site
5. Configure Extranet site to use SQL membership store

1. Configure SQL for membership store

The membership store is still created using the ASP.NET SQL Server Setup Wizard.  This is launched from the .NET 2.0 Framework folder on the server at:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe
This wizard will take you thorough the steps and will build out the SQL database for you.
alt
Once you select to Configure SQL Server for application services, you will be prompted for the SQL Server name and database name.  You can choose an existing database to add the membership elements to, or you can type in a new name and the database will be created for you.
Once the database is created, we’re going to create and add a SQL user, rather than use integrated authentication.  If your SQL instance is not already running in mixed-mode, you can change it through Server properties in SQL Server Management Studio.  Right-click on Server in Object Explorer and select Properties, then navigate to the Security page.
image

Create SQL user
Back in object Explorer, expand Security –> Logins.  Right-click logins and select “New Login…”  On the New Login page, enter a username, password on the general page, clear all three password options for policy, expiration, and enforce change. Hit Ok and we have our SQL user.
image

Add SQL user to membership database
Now, navigate to the database we created for our membership earlier (ConlosoDevFBA), and expand to Security-> Users.  Right-click on Users and select New User….
image
Enter the name, select Login name, and give this fella the role “db_owner”.
To recap:
We created a database called ConlosoDevFBA.
We created a SQL user called FormsAuthUser
We added FormsAuthUser to ASPNetFormsAuth database and gave them the db_owner role.
We’re done with SQL.

2. Configure Central Admin Web Site to use SQL Membership Provider

SharePoint web sites out of the box are configured to use Active Directory.  So you may be wondering why we’re configuring Central Admin to use FBA when we don’t really want to login in as an FBA user.  Well, we actually don’t want to configure it to to login as a forms user, but we do need to be able to add users from out membership database when configuring site collection admins, and the like.
So all we want to do is tell the Central Admin web application to use our SQL membership provider as well as AD, so when you use the people picker to select users, it will provide results from our membership database.
Open IIS Manager on the WFE server (if more than one, then this needs to be done on every FWE that has Central Admin.  The same goes for the proceeding steps for the other web applications).
Select the SharePoint Central Administration v4 site.  On the Home Page, you’ll see many options for ASP.NET and IIS.  The ones we’re concerned with are
image
Open the Connection Strings Page.  Under Actions menu on the right, select Add… to create a new connection string.  Provide the details for the membership database for the new connection string.
image

Add Role Provider
Go back to the Web Application page and open up Providers page.  Here we will create a provider for Roles and Users.  Set feature to .NET Roles and click Add… in the Actions pane to add a new role provider.  I called it FBARoleProvider and selected the right type and connection string.
Ensure you provide an ApplicationName so the provider knows what uses to authenticate.  For a good explanation on why you need this, see Scott Guthrie’s blog.
image

Add Membership Provider
Now set feature to .NET Users and click Add… from the actions pane to add a membership provider.
image
Select the correct type and connection string, and whatever behaviors you choose.
That’s it for the providers for Central Admin.
To verify that all looks ok, we can check the web.config of the web application.  To get to the right web.config, right-click on the web application under sites, and select Explore.
image
In the web.config, you’ll see sections for the connection string and the providers.  The <roleManager> and <membership> sections should look like:
image
You should also see a <connectionStrings> section close to the bottom of the web.config file.

3. Configure Secure Store Web Service to use SQL Membership Provider

Everything we did for Central Admin site, we are going to do for the SecurityTokenServiceAppliaation which is in the SharePoint Web Services application.
image
Without redo’ing all the steps:
  • Create the connection string
  • Add the .NET role provider
  • Add the .NET users provider
    Verify connection by editing config.xml.

4. Create Extranet Web Application

Ok, finally we are ready to create our web application (called SharePoint – FBA) that will use FBA authentication.
In Central Admin, Select the Application Management page, and select Manage web applications.  Select New from the ribbon to create a new web application.
Select Claims Based Mode Authentication as Authentication Type.  Select values for all the other options until you get to the “Enable Forms Based Authentication”.
Add the values we created earlier in the section “Enable Forms Based Authentication” for role and membership provider.
image
Once the application is created, we should create a site collection.
Create Site Collection
Go to the Create Site Collection page from the Manage Applications section in Central Admin.  Select the team (or blank, or whichever you choose) template then select the site collection administrator.  At this point, we should be able to select from our SQL membership users.  Enter a user you know exists in the membership database and see if you can resolve the names.
image
I have a user with the same name in both AD and SQL, so I know I am hitting both.
Note: I jumped ahead here and added users through IIS Manager.  If you have been following this article to the letter, then you will obviously not see users in your membership database.  Do not worry about this piece for now, as you will add users to your membership store later.

At this point we have told SharePoint what role providers to use for the web app, but we still need to configure the web app through IIS manager to bind the providers.
Configure Membership Providers for Web App through IIS
In IIS Manager, browse to the new site SharePoint – FBA. For our new FBA site we need to do the following:
  • Add connection string
  • Add Providers for members and roles
  • Configure .NET Roles
  • Configure .NET Users
  • Set Authentication to Forms and Integrated
  • Add User as Site Collection Admin
image

1. Add Connection String
Same as we have done before.
image
Note: we could potentially just do this for the machine, and not have to do it for every web application.  I prefer to do it for every web app, as I’ve had mixed results otherwise.

2. Add role and user providers
Again, same as what we did before.  Open Providers page and add an entry for our role and user providers.
image image

3. Configure .NET Roles
This and the next steps are not required for the other two web applications we configured (Central Admin and SSS).
Open the .NET Roles page for our web application.  You will receive a warning that the default role provider is not trusted.  WE just need to set our default role provider to FBARoleProvider.
image
We do not have any roles in our database at this point, so let’s create two (StandardUser, SuperUser) by clicking Add… in the actions pane.
image

4. Configure .NET Users
Now we need to do the same for .NET Users.  Open the .NET Users page.  You will get a similar warning saying the default is not trusted.  Set the default provider to FBAMembershipProvider. If you had members in the database, you would now see them listed.  Assuming you don’t let’s add some.  Click Add… from the Actions pane to add users, and assign them roles.
image image

5. Set Authentication
SharePoint should have done this when you created the web application, but let’s confirm.  From the web application home page in IIS Manager, select Authentication under the IIS section. Confirm that the web application has both Integrated and Forms enabled.

6. Add User as Site Collection Admin
Now that we have everything hopefully configured correctly, we can go back to SharePoint Central Admin and add our new user as the Site Collection Administrator.  From Central Admin Application Management page, click Change site collection administrators.  Select SharePoint – FBA root site collection, and add our new user.
image
Now lets test all this business by trying to login.  Browse to your site and select to login as a forms user.
image
What the…?!  I am authenticated ok, but am not allowed in, even though I’m a site collection admin?!
Caveat
Here’s the caveat – In order for you to use IIS Manager to manage your SQL users, you need to set the default provider to our Forms provider, i.e. FBAMembershipProvider.  In order for it to work we need to set it to the SharePoint claims provider.  Go back to .NET Users and reset the default provider to “i” which is for the Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider
image
You could work around this by creating another IIS web site, configure the same way you did for SharePoint – FBA, and use that for managing users.
You should also check the default Role Provider for the web application and ensure that is set to “c”.  If this is set to the SQL provider that you created, you will get an unexpected error after you logon.
Now let’s try to login again…
image
fba configure successfully.
To verify all of the above: here are the three web.config files in play:

Central Admin Web.config

<roleManager>
  <providers>
  <add name="FBARoleProvider" type="System.Web.Security.SqlRoleProvider,  
System.Web, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a"  
applicationName="/" connectionStringName="FBADB" />
  </providers>
</roleManager>
<membership>
  <providers>
    <add name="FBAMembershipProvider"  
type="System.Web.Security.SqlMembershipProvider,
 System.Web, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a" 
applicationName="/" connectionStringName="FBADB"  
enablePasswordReset="true" 
 enablePasswordRetrieval="false" passwordFormat="Clear" 
requiresQuestionAndAnswer="false" 
 requiresUniqueEmail="false" />
   </providers>
</membership>


Secure Store Web Service web.config

<membership>
   <providers>
       <add name="FBAMembershipProvider"  
type="System.Web.Security.SqlMembershipProvider
System.Web, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a" applicationName="/"  
connectionStringName="FBADB" enablePasswordReset="true" 
enablePasswordRetrieval="false"  
passwordFormat="Clear" requiresQuestionAndAnswer="false"  
requiresUniqueEmail="false" />
   </providers>
</membership>
<roleManager>
   <providers>
       <add name="FBARolePRovider"  
type="System.Web.Security.SqlRoleProvider,  
System.Web, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"  
applicationName="/" connectionStringName="FBADB" />
   </providers>
</roleManager>

Web Application (SharePoint – FBA) web.config
<membership defaultProvider="i">
  <providers>
    <add name="i" type="Microsoft.SharePoint.
Administration.Claims.SPClaimsAuthMembershipProvider, 
Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c" />
            <add name="FBAMembershipProvider"  
type="System.Web.Security.SqlMembershipProvider,  
System.Web, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a" applicationName="/"  
connectionStringName="FBADB" enablePasswordReset="true" 
 enablePasswordRetrieval="false"  
passwordFormat="Clear" requiresQuestionAndAnswer="false" 
requiresUniqueEmail="false" />
  </providers>
</membership>
<roleManager cacheRolesInCookie="false"  
defaultProvider="FBARoleProvider" enabled="true">
  <providers>
    <add name="c" type="Microsoft.SharePoint.Administration.Claims.
SPClaimsAuthRoleProvider, 
Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c" />
            <add name="FBARoleProvider"  
type="System.Web.Security.SqlRoleProvider, System.Web
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"  
applicationName="/" connectionStringName="FBADB" />
  </providers>
</roleManager>


 


Thursday, April 24, 2014

Configure Alternate Access Mapping in Sharepoint 2010

Alternate access mapping is commonly used to rewrite SharePoint URLs to more meaningful ones. Some scenarios require configuring AAM since the URL of a web request received by IIS may not necessarily be the same as the one that the users entered in their browser
 
STEP # 01
Open the SharePoint Central Administration page. Click the Configure alternate access mappings link under Application Management.





STEP # 02

In the Alternate Access Mappings page, click on the Edit Public URLs link.

 
STEP # 03
On the Edit Public Zone URLs page, make sure that you select the correct web application that you want to configure for alternate access mappings. Under the Public URLs, section, enter the new URL that you want mapped to the existing web application.


 STEP # 04
In this step, we have to open the hosts file located at C:\Windows\System32\drivers\etc and add an entry for 127.0.0.1 and point it to the new URL. You might need to open the Notepad with 'Run As Administrator' permission in order to do this.
 
STEP # 05
Even though we told SharePoint to listen that doesn’t mean IIS is listening to the new URL. Open IIS Manager and select your site. On the far left panel you will see ‘Bindings…’. Once the binding window is open for your SharePoint site click ‘Add…’. Enter your new URL into the ‘Host name:’ text box. (don’t add the ‘http://’)

  
STEP # 06
A modification must be done to the server's registry to specify the host name. To specify the host names that are mapped to the loopback address and that can connect to Web sites on your computer, follow these steps

1)Click Start, click Run, type regedit, and then click OK.

2)In Registry Editor, locate and then click the following registry key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

3)Right-click MSV1_0, point to New, and then click Multi-String Value.

Type BackConnectionHostNames, and then press ENTER.

4)Right-click BackConnectionHostNames, and then click Modify.

5)In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.

6)Exit Registry Editor, and then restart the computer.