Sunday, November 15, 2015

How to Recover Credentials from Secure Store Service in SharePoint using PowerShell

So the previous SharePoint administrator left without documenting passwords from SharePoint secure store Service? Unfortunately, There is no way to get stored user name, passwords from SharePoint secure store service from Central Administration site.

Recover secure store service credentials in SharePoint using powershell

No worries, Lets use PowerShell to decrypt all user names and passwords stored in SharePoint secure store service.

PowerShell script to Get Credentials from Secure Store Service: 
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Any web application associated with SSS proxy application or central admin
$WebAppURL="http://intranet.crescent.com"

#Establish the Context
$Provider = New-Object Microsoft.Office.SecureStoreService.Server.SecureStoreProvider
$Provider.Context =  Get-SPServiceContext -Site $WebAppURL
 
#Get All Target Applications
$TargetApps = $provider.GetTargetApplications()
foreach ($App in $TargetApps)
{
    Write-Output $App.Name
    
    #Get the credentials for the App
    $Credentials = $provider.GetCredentials($App.Name)
    foreach ($Cred in $Credentials)
    {
        $EncryptString  = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($cred.Credential)
        $DecryptString  = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($EncryptString)
 
        Write-Output "$($cred.CredentialType): $($DecryptString)"
    }
 }



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...