Skip to main content

Windows - 'Failed to store certificate' error

Comments

1 comment

  • Dzmitry Savitski

    A way to check this using PowerShell:

    $CurrentPath = 'C:\Users\<user>\AppData\Roaming\Microsoft\SystemCertificates\My\Certificates'
    while ((Split-Path -Path $CurrentPath -Leaf) -ne 'Microsoft') {
        $Acl = Get-Acl -Path $CurrentPath
        $Owner = $Acl.Owner
        Write-Output "$CurrentPath - $Owner"
        $CurrentPath = Split-Path -Path $CurrentPath -Parent
    }

    Fix acl, if needed:

    $FolderPath = 'C:\Users\<user>\AppData\Roaming\Microsoft\SystemCertificates'
    $Owner = '<domain>\<user>'
    & icacls.exe "$FolderPath" /setowner "$Owner" /T /C /Q > $null
    Write-Output "Ownership of $FolderPath has been changed to $Owner."

     

    1

Please sign in to leave a comment.