diff --git a/Powershellscripts/get-securestorecredentials.ps1 b/Powershellscripts/get-securestorecredentials.ps1 deleted file mode 100644 index 8643682..0000000 --- a/Powershellscripts/get-securestorecredentials.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue -#Any web application associated with SSS proxy application or central admin -$WebAppURL="https://collaboration-int.bauer-de.bauermedia.group" - -#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)" - } - } \ No newline at end of file diff --git a/Powershellscripts/remove-missed-feature-from-db.ps1 b/Powershellscripts/remove-missed-feature-from-db.ps1 deleted file mode 100644 index 2e582b8..0000000 --- a/Powershellscripts/remove-missed-feature-from-db.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -Add-PSSnapin Microsoft.SharePoint.PowerShell - - - -function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly){ - #$db = Get-SPDatabase | where { $_.Name -eq $ContentDb } - [bool]$report = $false - if ($ReportOnly) { $report = $true } - $db.Sites | ForEach-Object { - Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report - $_ | Get-SPWeb -Limit all | ForEach-Object { - Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report - } - } -} - -function Remove-SPFeature($obj, $objName, $featId, [bool]$report){ - $feature = $obj.Features[$featId] - if ($feature -ne $null) { - if ($report) { - write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red - } - else{ - try { - $obj.Features.Remove($feature.DefinitionId, $true) - write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Red - } - catch { - write-host "There has been an error trying to remove the feature:" $_ - } - } - } -else { -#write-host "Feature ID specified does not exist in" $objName ":" $obj.Url -} -} -Remove-SPFeatureFromContentDB -ContentDB "Your Content DB Name" -FeatureId "e9728ee6-7bfc-40a1-ad72-aa9a57e14407" -ReportOnly \ No newline at end of file diff --git a/Powershellscripts/testscript.ps1 b/Powershellscripts/testscript.ps1 deleted file mode 100644 index d225c4d..0000000 --- a/Powershellscripts/testscript.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -$env:COMPUTERNAME -Select-String -Pattern "sql" -Path c:\data\powershell\*.ps1 \ No newline at end of file