SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some powershell to create a farm including the secure store service. The code is pretty straight forward:

Update-SPSecureStoreMasterKey -ServiceApplicationProxy $id -Passphrase $passphrase

I dont get any errors but when I then try to create an application server key, thus:

Update-SPSecureStoreApplicationServerKey -ServiceApplicationProxy $id -Passphrase $passphrase

it fails and tells me the master key is not found:

Update-SPSecureStoreApplicationServerKey : Master secret key is not present in the database.

The thing is, this doesnt always fail. It's seems rather unreliable.

Anyone got a workaround or any clever ideas?


share|improve this question

I ran into this same issue. I'm embarrased to admit I stopped investigating when I found that Start-Sleep 5 seemed a reliable workaround.

Update-SPSecureStoreMasterKey -ServiceApplicationProxy $ssProxy -Passphrase xxx > $null
Start-Sleep 5
Update-SPSecureStoreApplicationServerKey -ServiceApplicationProxy $ssProxy -Passphrase xxx > $null
Start-Sleep 5

I guess theres a missing save/update/flush somewhere in those Cmdlets.

Not really a reasonable answer for a production quality solution but in my case I was trying to automate installation of our product for internal test purposes so a few sleeps were not a show-stopper.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.