
Secure Store Creds Şifresini Bulma
SharePoint içerisinde external data source erişmeye çalıştığınızda güvenli olması adına creds bilgilerinizi Secure Store Service aracılığı ile yapmanızda fayda vardır. Tanımlamış olduğunuz bilgileri unutmanız durumunda aşağıdaki PowerShell komutunu çalıştırarak ilgili şifrenizi görüntüleyebilirsiniz.
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
# Displays credentials for all target applications in the secure store service application in your farm.
$svcContext = Get-SPServiceContext -Site http://centraladminurl
$ssProvider = New-Object Microsoft.Office.SecureStoreService.Server.SecureStoreProvider
$ssProvider.Context = $svcContext
$ssProvider.GetTargetApplications() | ForEach-Object {
Write-Host "`n"($_.Name)
try {
$ssProvider.GetCredentials($_.ApplicationId) | ForEach-Object {
$ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($_.Credential)
$cred = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
Write-Host "`t$($_.CredentialType): $($cred)"
}
}
catch {
Write-Host "`t$($_)" -ForegroundColor Red
}
}