If you need an overview of what credentials Jenkins uses to clone repositories, you'll find that the Jenkins API is a bit convoluted. This is what I did instead:
- From a Windows machine, access Jenkins as a UNC share and dump its contents:
Get-ChildItem -Path \\my-jenkins-instance\*\config.xml | ForEach-Object { $targetPath = "C:\Users\me\Desktop\jenkins\" + $_.Directory.Name + "_" + $_.Name; $_ | Copy-Item -Destination $targetPath -Force }
The output will be a zip file with XML files containing job configurations. The filename contains the project name (as that information is not otherwise contained in the XML file).