Error Provisioning Secure Store Service Application

Feb 24, 2013 at 6:45 PM
Edited Feb 24, 2013 at 9:00 PM
The following error is being thrown when the scripts create the master key. This is occurring in a SP2013 installation. No errors where logged up to this point.

I can manually provision this successfully with the below PS.
Write-Host "Creating Secure Store Service and Proxy..."
New-SPSecureStoreServiceapplication -Name $secureStoreSAName -Sharing:$false -DatabaseServer $databaseServerName -DatabaseName "SecureStoreService" -ApplicationPool $saAppPoolName -auditingEnabled:$true -auditlogmaxsize 30 | New-SPSecureStoreServiceApplicationProxy -name "$secureStoreSAName Proxy" -DefaultProxygroup > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq "Secure Store Service"} | Start-SPServiceInstance > $null
Please advise!
- Creating the Master Key...
Update-SPSecureStoreMasterKey : There are no addresses available for this application.
At E:\SP\AutoSPInstaller\AutoSPInstallerFunctions.ps1:3028 char:13
+             Update-SPSecureStoreMasterKey -ServiceApplicationProxy $secureStore. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Offic...eStoreMasterKey:SPUpdateSPSecureStoreMasterKey) [Update-
   SPSecureStoreMasterKey], SPEndpointAddressNotFoundException
    + FullyQualifiedErrorId : Microsoft.Office.SecureStoreService.PowerShellCmdlet.SPUpdateSPSecureStoreMasterKey
Secure Store Configuration is as Follows:
<SecureStoreService Provision="true" Name="Secure Store Service" ProxyName="Secure Store Service">
      <Database>
        <Name>SecureStore</Name>
        <DBServer>wfe01.contoso.com</DBServer>
        <DBAlias Create="false" DBInstance="SERVER\INSTANCE" DBPort="" />
      </Database>
    </SecureStoreService>
May 5, 2013 at 4:00 AM
Any resolution on this? I'm getting the same error.
Jan 8, 2014 at 9:07 AM
I've had the same problem with my own deploymentscript.
This problem occures if you configure the secure store service application on a multi-server-sharepoint-farm.

I figured out, that the service instance "Secure Store Service" first starts on a diffent App-Server than the one you want to create the Keys for secure store.

Resolution:
You should implement a codesnipet before using the cmdlet 'Update-SPSecureStoreMasterKey' and 'Update-SPSecureStoreApplicationServerKey'.

Here is my Code I've used and it works pretty well:
Write-Host "Checking Secure Store Service Instance to be online..."
$SecStoreState = (Get-SPServiceInstance | ? {$_.TypeName -eq "Secure Store Service"} | ? {$_.Server.Name -eq $env:ComputerName}).Status
if ($SecStoreState -ne "Online") {
     Write-Host "Current state of secure store service application is: $SecStoreState ... trying to bring online now..."
     $SecStoreId = (Get-SPServiceInstance | ? {$_.TypeName -eq "Secure Store Service"} | ? {$_.Server.Name -eq $env:ComputerName}).Id.Guid
     Start-SPServiceInstance -Identity $SecStoreId
     while ($SecStoreState -ne "Online") {
          Write-Host "..." -NoNewLine
          $SecStoreState = (Get-SPServiceInstance | ? {$_.TypeName -eq "Secure Store Service"} | ? {$_.Server.Name -eq $env:ComputerName}).Status
     }
     Write-Host ""
}
Write-Host "Done."
Hope this will help you... it does for me.
Mar 18, 2014 at 12:47 PM
I had the same error on the latest AutoSPInstaller 3.96 (march 9th 2014) with Windows 2012R2 server, and SharePoint 2013SP1.
My problem was resolved by not using the domain\administrator as "farmsetup" account.

I created a new account which got sysadmin permissions in SQL and local admin on the sharepoint server.
After this the script ran without error.

Hope this helps anyone.

Stefan
Apr 10, 2014 at 5:28 AM
Worked for me!

Thanks Stefan.