Paul Alkema

Discussions on Web Development and Security

Paul Alkema

Pull a List of All Coldfusion Datasources, Along With Username and Passwords

April 20, 2010 · 64 Comments

There are special times when you may need to get a list of your datasources or retrieve the passwords for your datasources. If this is your case, no problem.

The script below will pull all datasources, along with the username and a decrypted password.

    // Create Data Source Object
    // Loop Through DataSources
    for(i in dataSourceObb) {
     // Get username
     // Get and decrypt password
     generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede",
     // Output all datasources along with username and passwords
     writeoutput("" & "DataSource: "  & i & "
" & "Username: " & username & "
Password: " & decryptPassword &"

"); } }


UPDATE: When this post was originally posted, this worked on 9, however since then 9.0.1 has been released. This version has fixed this issue.

Tags: Coldfusion, Datasource Passwords, ColdFusion Passwords, ColdFusion ServiceFactory, Paul Alkema

Tags: ColdFusion