Creating databases causes “Access Denied” error when installing Skype for Business Server 2015 Standard Edition…

Posted by in Lync, Skype for Business

I installed the first vanilla Skype for Business Standard Edition Front End Server into our organisation the other day and came across a strange error.

First off, I’m not sure whether this is Skype for Business specific or if it happened with Lync Server 2013 too? A simple Google (or Bing if you want to see less relevant results) shows that other people have indeed encountered it but we’ve got plenty of Lync servers with the same group policy, server build, permissions etc and we’ve never had this issue before.

When running the “Step 2” part of the “Install or Update Skype for Business Server System” I was receiving an Access Denied when it tried to create the databases in the CsData folder. I was of course running the installer with elevated privileges and nothing had changed within the environment with regards to permissions etc.

Specifically in the logs I was seeing the following:

Create-RtcDatabaseStore log:

Creating database rtcdyn from scratch. Data File Path = D:\CsData\RtcDatabaseStore\rtclocal\DynDbPath, Log File Path= D:\CsData\RtcDatabaseStore\rtclocal\DynLogPath.
Clean installing database rtcdyn.
Creating database rtcdyn. Attempt: 1
Microsoft.SqlServer.Management.Smo.FailedOperationException: Create failed for Database ‘rtcdyn’. —> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. —> System.Data.SqlClient.SqlException: CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file ‘D:\CsData\RtcDatabaseStore\rtclocal\DynDbPath\rtcdyn.mdf’.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

Create-BackendStore log:

Creating database rtcshared from scratch. Data File Path = D:\CsData\BackendStore\rtc\DbPath, Log File Path= D:\CsData\BackendStore\rtc\LogPath.
Clean installing database rtcshared.
Creating database rtcshared. Attempt: 1
Microsoft.SqlServer.Management.Smo.FailedOperationException: Create failed for Database ‘rtcshared’. —> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. —> System.Data.SqlClient.SqlException: CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file ‘D:\CsData\BackendStore\rtc\DbPath\rtcshared.mdf’.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

There are also similar failures for Create-LyssStore, Create-ApplicationStore and Create-ABSStore.

To overcome the issue I had to give NETWORK SERVICE Full Control NTFS permissions on the CsData folder in order to get the installer to continue.

Now for the disclaimer. Whilst this fixed the issue I’m not totally sure of the implications to giving NETWORK SERVICE this level of NTFS permissions over the CsData folder. As I said before, none of my other Lync servers have this permission on the CsData folder. I might remove these permissions at some point and see if it breaks.

If anyone else has any info regarding this I’d be interested to hear your thoughts.