Skip to content

Powershell script to Retrieve Secure Store ID credentials in SharePoint

November 18, 2019

Try below script to

$site = Get-SPSite -Identity $(Get-SPWebApplication -IncludeCentralAdministration | ?{ $_.IsAdministrationWebApplication}).Url
$SecureStoreProvider.Context = Get-SPServiceContext -Site ($site)
$SecureStoreProvider.GetTargetApplications() | ForEach-Object {
Write-Host $_.Name
try {
$SecureStoreProvider.GetCredentials($_.ApplicationId) | ForEach-Object {
$Credential = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($_.Credential))
Write-Host “`t$($_.CredentialType): $($Credential)”
} catch {
Write-Host “`t$($_)” -ForegroundColor yellow

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: