Getting an error "Key not valid for use in specified state." or "Requested registry access is not allowed." and roll back at the end of the installation or upgrade of the Storage Point.
Below sample screenshot of the error
Quest Metalogix Storagepoint team has created a script from .NET code to verify the issue.
Run the below Script 1 or Script 2 to verify the encrypted passphrase can be read.
** You will need to be a Farm Administrator and Have access to Management Shell rights( SPShell admin right can be referenced here)
Script 1
Clear-Host
$spAssembly = [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint')
$originalString = 'abc'
$secureString = ConvertTo-SecureString $originalString -AsPlainText -Force
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$spFarm = Get-SPFarm
try
{
$spCredentialManagerType = $spAssembly.GetType('Microsoft.SharePoint.Administration.SPCredentialManager')
$methodName = 'GetFarmEncryptionKey'
$getFarmEncryptionKeyMethodInfo = $spCredentialManagerType.GetMethods(@('NonPublic','Static')) | Where-Object { $_.Name -eq $methodName -and ($_.GetParameters() -ne $null) -and ($_.GetParameters().ParameterType -eq [Microsoft.SharePoint.Administration.SPFarm]) }
$farmEncryptionKey = $getFarmEncryptionKeyMethodInfo.Invoke($null, $spFarm)
$spFarmEncryptionKeyHexa = ($farmEncryptionKey | ForEach-Object ToString X2) -join ''
Write-Host ("SP farm master key: {0}" -f $spFarmEncryptionKeyHexa)
$encryptWithMasterKeyMethodInfo = $spCredentialManagerType.GetMethod('EncryptWithMasterKey', @('NonPublic','Static'))
$encryptedWithMasterKey = $encryptWithMasterKeyMethodInfo.Invoke($null, $secureString)
$encryptedWithMasterKeyHexa = ($encryptedWithMasterKey | ForEach-Object ToString X2) -join ''
Write-Host ("Text '{0}' encrypted by SP farm master key: {1}" -f $originalString, $encryptedWithMasterKeyHexa) -ForegroundColor Green
}
catch
{
$_.Exception | format-list -force
}
Script 2
Clear-Host
$spAssembly = [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint')
try
{
$spCredentialManagerType = $spAssembly.GetType('Microsoft.SharePoint.Administration.SPCredentialManager')
$methodName = 'GetFarmEncryptionKey'
$getFarmEncryptionKeyMethodInfo = $spCredentialManagerType.GetMethods(@('NonPublic','Static')) | Where-Object { $_.Name -eq $methodName -and ($_.GetParameters().Length -eq 0) }
$farmEncryptionKey = $getFarmEncryptionKeyMethodInfo.Invoke($null, $null)
$spFarmEncryptionKeyHexa = ($farmEncryptionKey | ForEach-Object ToString X2) -join ''
Write-Host ("SP farm master key: {0}" -f $spFarmEncryptionKeyHexa)
}
catch
{
$_.Exception | format-list -force
}
Sample Error Script 1
1) This is not a Quest product issue. We highly recommended getting assistance from Microsoft to get the issue fixed.
2) Once the issue has been fixed, please verify the issue using either one of the scripts again to get the expected output as shown below.
Script 1
Clear-Host $spAssembly = [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint') $originalString = 'abc' $secureString = ConvertTo-SecureString $originalString -AsPlainText -Force Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $spFarm = Get-SPFarm try { $spCredentialManagerType = $spAssembly.GetType('Microsoft.SharePoint.Administration.SPCredentialManager') $methodName = 'GetFarmEncryptionKey' $getFarmEncryptionKeyMethodInfo = $spCredentialManagerType.GetMethods(@('NonPublic','Static')) | Where-Object { $_.Name -eq $methodName -and ($_.GetParameters() -ne $null) -and ($_.GetParameters().ParameterType -eq [Microsoft.SharePoint.Administration.SPFarm]) } $farmEncryptionKey = $getFarmEncryptionKeyMethodInfo.Invoke($null, $spFarm) $spFarmEncryptionKeyHexa = ($farmEncryptionKey | ForEach-Object ToString X2) -join '' Write-Host ("SP farm master key: {0}" -f $spFarmEncryptionKeyHexa) $encryptWithMasterKeyMethodInfo = $spCredentialManagerType.GetMethod('EncryptWithMasterKey', @('NonPublic','Static')) $encryptedWithMasterKey = $encryptWithMasterKeyMethodInfo.Invoke($null, $secureString) $encryptedWithMasterKeyHexa = ($encryptedWithMasterKey | ForEach-Object ToString X2) -join '' Write-Host ("Text '{0}' encrypted by SP farm master key: {1}" -f $originalString, $encryptedWithMasterKeyHexa) -ForegroundColor Green } catch { $_.Exception | format-list -force }
Sample Output screenshot of Script 1
Clear-Host $spAssembly = [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SharePoint') try { $spCredentialManagerType = $spAssembly.GetType('Microsoft.SharePoint.Administration.SPCredentialManager') $methodName = 'GetFarmEncryptionKey' $getFarmEncryptionKeyMethodInfo = $spCredentialManagerType.GetMethods(@('NonPublic','Static')) | Where-Object { $_.Name -eq $methodName -and ($_.GetParameters().Length -eq 0) } $farmEncryptionKey = $getFarmEncryptionKeyMethodInfo.Invoke($null, $null) $spFarmEncryptionKeyHexa = ($farmEncryptionKey | ForEach-Object ToString X2) -join '' Write-Host ("SP farm master key: {0}" -f $spFarmEncryptionKeyHexa) } catch { $_.Exception | format-list -force }
Sample Output screenshot of Script 2
© ALL RIGHTS RESERVED. Feedback 이용 약관 개인정보 보호정책 Cookie Preference Center