A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq

Thursday, November 22, 2012

SharePoint 2013: AAM configured URL redirects to another URL

TIP

If you have setup two URLs in the same zone  in Alternate Access Mappings then the second URL will redirect to the first one. To resolve the problem, change the zone of one of the URLs. For example, you can choose Custom for one the zones. Now both URLs will work.

SharePoint Designer 2013: Data Source Type is empty

If you are creating an external content type in SharePoint Designer 2013 and you get empty data source type when adding a connection then most probably you are using a Preview version of the designer. SharePoint Designer 2013 Preview has a problem. It does not load data source type drop down. To reproduce the problem:

1, Open SharePoint designer 2013 Preview.
2. Under Site Objects, click External Content Types.
3. Click External Content Type button in the ribbon.
4. In the section "External Content Type Information", field "External System", there is a link "Click here to discover external data sources and define operations". Click it.
5. Click Add Connection button. The drop down will be empty.



The only solution, as far as I know, is to use SharePoint Designer 2010 or SharePoint Designer 2013 RTM. Good thing, this has been fixed in the 2013 RTM version.
 

SharePoint 2013 - Setup multiple URLs in DNS and configure Alternate Access Mappings


In the previous article “SharePoint 2013 - Setup DNS and use FQDN to access SharePoint sites” you learned how to setup DNS and use FQDN to access sites in SharePoint 2013. In this article, you will learn how to add new URLs for different sites (departments). For example, you can setup a URL for your finance department, HR department, etc.

1.       Now you have setup the domain services, you can use multiple URLs to access SharePoint sites. As mentioned in previous article, one way to access your SharePoint site is to use the machine name in the URL, for example, http://sp2013 (sp2013 is the machine name). With domain setup on your server, you can now access same site using URL like http://sp2013.walisystems.com. Please note that walisystems.com is the FQDN. Now, the fun part starts. We will setup a new URL www.walisystems.com to access your root site collection.

2.       Open Server Manager. Expand Roles. Expand DNS. Expand MACHINENAME. Expand Forward Lookup Zones. Right-click FQDN and select New Host (A or AAAA)….


3.       In the Name box, enter www. In the IP address, enter IP.

 



To find the IP of your machine, go to command prompt and run IPCONFIG command. Note down IPv4 Address. This is the IP of your machine.



After entering the IP, click Add Host button. This will add a new A record.

 



4.       Now, we will create a new web application and site in SharePoint that will use this new URL. Open Central Administration site. Click Application Management. Click Manage web applications.

 



You will see there are two web applications (if it’s a new setup). One is your main site and the other central administration site.

5.       Click New button in the ribbon to create a new web application. A form will open.




 
6.       Enter 80 in the Port. Enter www.walisystems.com (Your A Record that you created above) in the Host Header. Keep all other default values and click OK.

 

7.       Next, create a new site collection. On the Application Management page, click Create Site Collections. From the Web Application drop down, select newly created web application.

 

8.       Enter Title and Description of the site collection.

 

9.       In Web Site Address section, in URL drop down, select / (front slash) for the root site collection. You can only create one top level site collection per web application. For more site collections, you have to create managed paths. There is a link called Define Managed Paths in Web Site Address section (on the same page). Also, if you have already used root site collection, Create Site Collection page will automatically show you /sites/  managed path. If you want to use a managed path then you have to enter a site collection name in the text box after the drop down.

 

10.   In the Template Selection, keep 2013 selected in the experience version drop down. Keep Team Site  selected under Collaboration tab.

 

11.   Enter Primary Site Collection Administrator.

 

12.   Click Ok to create site collection.

 

13.   When new web application is created, a default entry is automatically added in the Alternate Access  Mappings. To see the new entry for your web application, on the Application Management page, click Configure alternate access mappings. You will see new web application listed and the zone will be Default.

 

14.   Now, let’s add another URL for the HR department. Repeat steps 2 and 3 above to add a new host entry but instead of entering www, enter hr. IP will remain same.

 

15.   Now, you can create a new web application and site collection for the HR department just like you did above OR you can use an existing web application. You have already seen how to create new web application and use new URL. Now you will existing web application that you created above and use Alternate Access Mappings to forward new URL to that web application.

 

16.   On the Application Management page, click Configure alternate access mappings link.

 

17.   Click Add Internal URLs.

 

18.   From the Alternate Access Mapping Collection drop down, select the newly created web application.

 

19.   Enter new URL (new host entry for the HR department, for example, http://hr.walisystems.com) in the URL protocol, host and port field.

 

20.   In the Zone drop down select Custom.

 

21.   Click Save.

 

22.   Open new URL (http://hr.walisystems.com) in the browser. Your new site collection will open.

 

 

I hope information in this article was useful for you. Please do leave feedback in the comments below.  Thanks for reading!

 

SharePoint 2013 - Setup DNS and use FQDN to access SharePoint sites


In this article, you will learn how to create alternate URL for your SharePoint 2013 site. By default, you can access SharePoint site by using machine name, for example, if your machine name is MYCOMPANY, you can access SharePoint site using URL http://mycompany (provided you have a site collection set up at that URL). Now, suppose you want to have a meaningful URL for your site, for example, www.mycompany.com OR if you have different departments in your company and you want each department to access their site using their own URL, for example, http://hr.mycompany.com, http://finance.mycompany.com ,  etc., this can be achieved by configuring DNS. My assumption is that you have admin rights on the machine and you can add DNS role and configure it. To read more about SharePoint 2013 machine configuration, wait for my upcoming book on SharePoint 2013. I am just trying to finish up some new chapters. I may not wait till all chapters are ready and may release machine configuration part separately so stay tuned to this blog. In the steps below, you will add Active Directory Domain Services and set up a FQDN.

1.       Go to All Programs > Administrative Tools  and click Server Manager.

2.       Click Roles and then click Add Roles link.

3.       Click Next and then select the second check box Active Directory Domain Services and click Next >. Click Next again and then click Install. Installation will start and will take approx. 10 minutes to complete (depending on your computer’s speed). Click Close once the installation has completed.

4.       Click Active Directory Domain Services link. You will see following warning message:

This server is not yet running as a domain controller. Run the Active Directory Domain Services Installation Wizard (dcpromo.exe).

Click the link in this message to install Active Directory Domain Services.

5.      Click Next. Click Next again. Select the second option Create a new domain in a new forest and click Next.

6.      Provide a FQDN, for example, sp2013.com and click Next. I will use walisystems.com as that is my main domain. You will see this domain in the screenshots in this section.

7.      Select Windows Server 2008 from the drop down and click Next.

8.      Keep DNS server checked and click Next.

9.      You will see a warning message. Select first option Yes, the computer will use dynamically assigned IP address (not recommended). if you don’t want to assign a static IP to your computer  and click Next. If you want to make the change, assign static IP and run the wizard again.

10.  Next you may see this error:

 


 



Click Yes.


11.  You will be presented with another screen. Keep default values and click Next.

12.  Enter password for Directory Services Restore Mode Administrator Mode and click Next.

13.   Review your selections and click Next. DNS Installation starts.

14.  Click Finish after the installation has completed.

15.  Click Restart Now button to restart your machine.

16.   Open Server Manager again. Expand Roles. Expand Active Directory Domain Services. Expand Active Directory Users and Computers. You will see your domain listed there.


 



17.   Now you have setup the domain services, you can use multiple URLs to access SharePoint sites. As mentioned earlier, one way to access your SharePoint site is to use the machine name in the URL, for example, http://sp2013 (sp2013 is the machine name). With domain setup on your server, you can now access same site using URL like http://sp2013.walisystems.com. Please note that walisystems.com is the FQDN that we used while setting up DNS.

 
In the next article, you will learn how to add multiple URLs for different departments and configure Alternate Access  Mappings in SharePoint.

 
If you liked this article or gained something out of it, then please leave feedback. Your feedback is of paramount importance to me. Thank you for reading.

SharePoint 2013 Alternate Access Mapping


Alternate Access  Mapping (AAM) is a feature that allows a website to use different URLs. This is usually needed when you have different zones, for example, one for the Intranet and another for an Extranet. I will not cover the network configuration part to setup an alternate URL in the DNS. I assume you already have an alternate URL and you just want to configure the AAM. If you want to read about DNS configuration and how to setup alternate URLs in the DNS, read my upcoming book on SharePoint 2013 (name not decided yet) or wait for another blog post that will explain the process of setting up DNS.

Assuming you have following two URLs, the process to configure AAM is easy.

1.       http://sp2013

2.       http://sp2013.server.com

 

1.       Open Central Admin Site and click Application Management.

2.       Under Web Applications, click Configure alternate access mappings.

3.       You will notice you already have http://sp2013 listed there in the Default zone. To add new URL in the Intranet zone, click Add Internet URLs.

4.       From the Alternate Access Mapping Collection drop down, select correct application that you want to use for the AAM setting and then add URL in the text box labeled URL protocol, host and port, for example, http://sp2013.server.com.  From the Zone dropdown, select Intranet.

5.       Click Save.
 


SharePoint 2013 Business Connectivity Services Login failed for user NTAUTHORITY IUSR


If you have created an external content type and are tryingto access it in a list and get AccessDenied, that is because you have not given permissions to the logged inuser to use that external content type. You can easily give permissions to thatuser or to all users in your site by going to central administration site andconfiguring business connectivity service. For exact steps on how to do it,read my following blog:

SharePoint 2013 Business Connectivity Service Access DeniedError: http://blog.walisystemsinc.com/2012/11/sharepoint-2013-business-connectivity.html

Some users get another very interesting error message afterthey have assigned permissions on the external content type. The error messageis:

Message from ExternalSystem: ‘Login failed for user ‘NT AUTHORITY\IUSR’.’.


 This error occurs because database does recognize thecredentials passed from SharePoint. Which database? Database that you areconnecting to in your external content type! It depends on you have setupapplication pool identity in SharePoint. If you are not using managed serviceaccount for your services, you are most likely to get this error. This is notlikely to occur in corporate environments but in home or test environmentswhere users use LOCAL SYSTEM OR NETWORK SERVICE in application pools,this error will occur. This is because NETWORKSERVICE translates to NTAUTHORITY\IUSR when credentials are passed from web server to databaseserver. IUSR is used when usercredentials are not available, for example, for anonymous users. To resolvethis problem, either change application pool identity or add NT AUTHORITY\IUSR to the database permissions.The first scenario is quite common. You can change application pool identity bygo to the web server and updating application pools or by logging intoSharePoint central admin site and going to ManageService Accounts. We will cover second scenario here, that is, to add IUSR to the database.

1.      Go to MicrosoftSQL Server Management Studio and connect to your database server.

2.      Expand Securitynode and right-click Logins node andselect New Login.



3.      In the LoginName, enter IUSR and click Search…. This will open a new searchbox. Enter IUSR in the object nameand click Check Names. Click OK.

4.      You will notice that Login Name has been populated with MACHINENAME\IUSR where MACHINENAMEis your machine name, for example, in the figure below, you see SP2013\IUSR. SP2013 is my machine name.


This is not what you want to add to the logins. Change MACHINENAME to NT AUTHORITY so Login Name shouldread NT AUTHORITY\IUSR. Click OK.

5.      Now you may think that the user has been addedand your external content type will work. Right? Wrong! You still have to mapuser to the database otherwise you will get following error on the list page(where you are trying to load external content type):

The query against thedatabase caused an error.



 



 
This error occurs, as I said, because user is not mapped tothe database yet.

6.      To map user to the database, right-click NT AUTHORITY\IUSR in Logins and select Properties.


 


7.      There are two ways to do this mapping. One wayis to add user to one of the server roles, for example,  serveradminor sysadmin. This will give userfull rights to all databases and thus you won’t have to do explicit mapping. Todo this, on the properties page, click ServerRoles and check sysadmin. Click OK. Obviously you would not want to dothis in real environment. So the other option is to map the user directly tothe database that has been used in the external content type.



To add user mapping, in LoginProperties, click User Mapping.Locate the database in the list and then check the box in the Map column. As soon as you check thebox, NT AUTHORITY\IUSER appears inthe User column. That’s it. Click OK to save the setting. By the way onthe same properties page, you can also assign database role membership to theuser for the database but that is not required.



Now, go back to the list page and reload it. You will seeresults from the external data source.

 




 

SharePoint 2013 Business Connectivity Services Access Denied Error


In SharePoint 2013, If you have setup Business Connectivity Services, or BCS for short, and now you are trying to access an external content type in a list but you get “Access denied by Business Data Connectivity”, here is you will solve it.

 


 This error occurs because the logged in user does not have permissions on the external content type that you had created. To resolve the issue go to central administration site and give permissions to specific users on the external content type.

1.       Open SharePoint Central Admin site.

2.       Click Application Management.

3.       In Service Applications section, click Manage service applications.

4.       Click Business Data Connectivity Service.

5.       You will see your external content type listed on this page. Select it (by checking the box) and click Set Object Permissions button in the ribbon.



 6.       This will open a dialog box. Enter username that you want to give permission to in the box and click Add. Select the added user in the box below and select permissions for that user by checking the boxes against the listed permissions. Depending on the type of user, you can select which permissions to give. For example, giving them Execute permission will let them see the results. If the user is admin type, then give them all the permissions. Lastly, check the box at the bottom to “propagate” permissions to all methods of the external content type. Click OK to save the settings.

 

 



 Also, if you want to give access to all users in the organization, add NT Authority\Authenticated Users in the box at the top and click Add and then assign desired permissions as described above. When you add authenticated users, you see All Users (windows) listed as one of the users.