Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

Thanks

share|improve this question

1 Answer 1

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

 
discard

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.