Monday, 21 July 2014

Configuring Apps for SharePoint 2013

Let’s take a look at making use of the one of the new features of SP2013, Apps. Whether you’re planning to use downloadable apps across your organisation or a developer creating your own, both require a correctly configured app infrastructure.
MS recommend that you have a separate domain name for Apps that is not a child of the domain in which your servers are sitting. They also say you need to ‘purchase’ a domain name, what they fail to say is this is only applicable if your publishing apps externally. If, like me you’re configuring this within the walls of your corporate network, then simply creating a new domain is possible without making a purchase in the real world.
Important! – This isn’t creating a new domain as you may imagine, because that does sound overkill right? Actually it’s about creating a domain (zone) in DNS. This then needs to have a wildcard alias. This is so your App namespace can eventually be ‘AppName.DomainName’.

Head over to your DNS console and create a new Forward Lookup Zone, this should be of type ‘Primary’ and replicate to all DNS servers in the domain.


Now this is present, we now need a new Wildcard Alias for this zone. Right click on the new domain you just created and choose CNAME, add an * to denote wildcard in the Alias Name section. In FQDN, add in the full URL of your SharePoint site.


OK, were done now for DNS, let move onto to configure SharePoint. We need two service applications created to deal with the App infrastructure, App Management Service Application and Subscription Settings Service Application, and their associated proxies.

As for App management, not really anything out of the ordinary here. Central Admin – Service Applications – New – App Management Service

Give the Service Application a decent name, its own database and app pool and let it create an App Management Service Application Proxy.



When done this will appear in the list of Service Applications


Now for the harder bit, the Subscription Settings Service Application cannot be created in Central Admin. PowerShell only for this one folks.

Open up the SP Management Shell on of your 2013 servers, run the following to set a variable with the desired managed account, obviously his account must be present in managed accounts in central admin – security:

$account = Get-SPManagedAccount "ServiceAccountName" 

OK, now let’s create a new application pool using the account we set earlier and store to a variable.
 
$appPoolSubSvc = New-SPServiceApplicationPool -Name “Subscription Settings Service Application Pool” -Account $account



And now to bring it all together, creating the service application using the variable we created before, we’re adding the name of the Service Application here and giving it a database name:

$appSubSvc = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name “Subscription Settings Service Application” -DatabaseName SharePointSubscriptionSettingsService



And finally, the proxy for the Settings Service Application, we don’t get the option of giving it a name here.

$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc



Worthwhile heading to Central Admin – Security – Service Accounts and checking that your new Pool is present with the correct managed account attached.

Also we should have our new Service Application and proxy in the Service Application list

Now, head over to Application Management – Manage Services on Server and make sure the ‘App Management Service’ and (this one is harder to spot) the ‘Microsoft SharePoint Foundation Subscription Settings Service’ has been started.



Now give the box a cursory IISRESET


Head to Central Admin - Apps and click on Configure App URL’s

A tell tale sign here that you’ve configured everything correctly! If there is an error, you haven’t!
On this screen we set supply SharePoint with the app domain we created earlier in DNS. Also you need to go for a prefix for the apps. I’ve gone for SP, but you can go for anything you want.


Time to create an App Catalog Site. Choose ‘Manage App Catalog’ from the Apps page in Central Admin.
Change the web application to the one in which you wish to create the site collection, and select ‘Create a new app catalog site’


Hit next and at the next screen you create a site collection just like any other. The only difference being adding the ‘End Users’ i.e. group of people that can see the apps in the store.
You can add AD groups in here or individuals. If this is for all your users, then add ‘Everyone’, that should cover it.

Okay, so now we run into a bit of a gotcha. Although everything is configured correctly, and you can head to the app catalog and add apps. If you attempt to use an app you've added you will get a HTTP 404. This is due to our wildcard domain we created in DNS. The app URL will be correctly produced, with the prefix-appid.domain which in-turn resolves to your SharePoint box but obviously IIS is not recognising this host header and knowing which web application to route it to.

The solution to this is to create an 'empty' web application on port 80 without a host header. This will then receive any unrecognised requests and know what to do with them. Give this a name of something descriptive, I've called mine 'SharePoint App Host', on port 80 and leave the host header blank.

Important!
- Make sure the app pool you choose has access to the web application databases you're using for your apps. Otherwise you will get random access issues. So you want to choose the same app pool as your other web applications, or, if creating a new one (as I am in the screenshot below) choose the same security account you used for the other pool..



You'll notice in the screenshot above that I've called the database 'temp' this doesn't matter as when the web application has been created, you can go to Databases - Manage Content Databases and remove this.

Now you should be able to add, use and develop apps!




Monday, 14 July 2014

SSRS 2012 R2 Integration with SharePoint 2013

So it came to my attention the other day that the setup for the SQL Server Reporting Services with SharePoint 2013 wasn't the most straight forward I've installation or configuration I've ever done. If you've got a multi-tier farm like we have, you'll have to actually install the Reporting Services on one of the SharePoint 2013 Servers away from the SQL Server box. In our environment, our Search runs on our second application server, so I decided to install SSRS 2010 R2 onto my first application server.


Mount the SQL ISO onto your SharePoint Application server. The reason for this install is to have Reporting Services talk to SharePoint. You'd rather not install SharePoint onto your SQL box, so the best solution is to install Reporting Services onto the SharePoint box. When coming to create the database for ReportServer, your DBA's may have a certain naming convention they like to use, so you'll want to use this when creating a database from SharePoint for SSRS.

Go through the SQL Reporting Services setup as below as we're only installing SSRS in SharePoint Integrated mode.








When you get to the below screen, choose the following options:













After running these steps, restart the server. 

Once restarted, you'll need to enable the services on the server. I used the powershell commands:

1. “Install-SPRSService “ cmdlet from “SharePoint 2013 Management Shell”
2. Run “Install-SPRSServiceProxy” to install the service proxy
3. Run “get-spserviceinstance -all | where {$_.TypeName -like "SQL Server Reporting*"} | Start-SPServiceInstance” to start the service.


It may say, the services have already been started, which is fine. Go into Central admin and make sure that they are started for sure.


The next step would be to create the SQL Reporting Services Service Application.

Click on Application Management > Manage Service Applications from Central Admin, then New and choose the SQL Reporting Services Service Application.


Fill in all the required details including the name of your Report Server which your DBA may want named in a certain way. And press OK.


Once done, you are all set to go.

You can either create a document library to store reports or see the content types now on your sites.

Friday, 11 July 2014

Deploying and Configuring Office Web Apps Server 2013



I'm installing a single server Office Web Apps 2013 'farm' on a Windows 2012 R2 box.
First up, getting hold of the software.. No subscription needed just head over to Microsoft's website grab yourself the .img file, I wont make you go hunting, the link is here! (UPDATE: I'm afraid now this is not the case, Microsoft have decided to only make this available on the VLSC / MSDN download centers.) While we're in the realm of the Microsoft site, you may as well pick up the latest service pack for it: SP1
(note, you are still required to have a licence, at least for editing Office files, but it is likely you are covered under your EULA if you have one)
OK, before we can install this we need a few prerequisites, luckily nothing to download here, there is a nice little PowerShell one liner to get the server up to speed. Open up a PowerShell window as Admin and run:

Add-WindowsFeature Web-Server,Web-Mgmt-Tools,Web-Mgmt-Console,
Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Static-Content,
Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,
Web-Security,Web-Filtering,Web-Windows-Auth,Web-App-Dev,
Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,
Web-Includes,InkandHandwritingServices,NET-Framework-Features,
NET-Framework-Core



When complete, you will be reliably informed that you need a reboot.



You can do this right from your PowerShell window by going for
Restart-Computer

Have a check in Server Manager - Manage - Add Roles and Features and check you have some role and features added:



OK, lets move onto install Office Web Apps Server 2013, this is much less exciting than it sounds!

Mount the .img file you downloaded earlier and run it, choose a file location to install to. Generally as good practice (this applied to SharePoint also) I install my OS and Program files on different drives, you will see here I am going for E:\Microsoft Office Web Apps


This then installs with no other options and quietly completes. Nothing to see here!

Onto the Service Pack, run this, accept the agreement, hit continue, again nothing special or noteworthy.



There's a couple of installation scenarios, basically the decision is between single or multi server farms and HTTPS or HTTP. Microsoft recommend in a production environment HTTPS is used. Also if you're going to be using this server farm to service Lync 2013, there aint no option but to go for SSL secured. I do plan to use this for Lync and Exchange 2013 and so will need to be going for the HTTPS option. Making this blog fully fledged but we have to get into creating certificates etc.

Right, so we're going to need to activate the WCF Services HTTP Activation feature to allow us to securely communicate. Head to Server Manager - Manage - Add Roles and Features. Open up the .Net framework 4.5 group, WCF Services and tick on 'HTTP Activation'


You then need to confirm and carry on installing this


Let's now sort out the certificate. This is assuming you have a certification authority setup in your domain. 

Start - MMC - Add or Remove Snap-in

Add the Certificates Snap-in


We want to access certificates for the local computer account
Now you should see the certificate store, we're going to carry on a right click on Personal, choose All Tasks - Request New Certificate
Luckily my 'administrator' has configured the enrollment policy, so i'm going to choose that
We want a Web Server certificate, and due to the encryption options i want to have the choice of later, i'm going for Enterprise
You will see it says that more information is required to continue, clicking this link we see the following window.In here, we need to add the Common Name (CN) in the subject name field. The common name is the name of the server, not fully qualified. If you're planning to have the url the name of the server with a port then this is all for this screen. If you're having a DNS entry pointing to this server you can add this in the Alternative Name section, but for me, just the CN is good enough.
On the General tab, choose a friendly name, make this something meaningful. I have copied this into the description as the description is sometimes displayed in places the name is not, so this covers all bases!
Now, following is one of the differences we get from the enterprise web server certificate option, we want a key length of 2048. This is already selected. We also need to select the box 'Make private key exportable'
In the Certification Authority tab, select your authority.
Click OK and this will take you back to the Certificate Enrollment screen where we can now press 'Enroll'
The certificate will appear in the console
Check this has also appeared in IIS. Head to Server Certificates. Do not bind this, the setup powershell command does the magic for us.
Time now to create the Office Web Apps Farm. Open up a PowerShell window and run the following command. Obviously replacing the red text with your own details.
New-OfficeWebAppsFarm -InternalUrl "https://yourserver.fqdn-CertificateName "Office Web Apps Certificate Friendly Name-EditingEnabled

Note that the 'EditingEnabled' switch is only if you have a licence for editing. You will get a nice little warning about this in the window asking you to confirm. Then followed by a whole load of gumf about the farm details.

Now the moment of truth, time to test that your server is working. On your local machine, enter the https url (which is basically the server name) with /hosting/discovery at the end. All being well you should see an XML output resembling the following


Once you've confirmed the OWA server is accessible via a secure URL, time to bind 
SharePoint to it. Head over to your SharePoint App server and open the SharePoint 
PowerShell window (- as Admin of course!)
Run the command 
New-SPWOPIBinding –ServerName “owaserver.fqdn”

This should flash up all the bindings to various applications being created.
That’s it done! Time to test.
Head to a document library on SharePoint 2013, find a Word document and click on 
the three dots next to it for additional details. This should load with a large area for
preview, then show you Office Web Apps is loading as per the following image. 
All being well this will load and show you a preview of the document!