Getting a list of all users in a DNN instance using SQL


If you would like to get a list of users who had logins for the site, you can export all users on your site using a simple SQL query run through the SQL Console.



  1. Log in to a SuperUser Account.
  2. Go to Persona Bar > Settings > SQL Console
  3. Run the following SQL query, replacing the # with your desired PortalId:
    • SELECT users.userid
      FROM userportals
      INNER JOIN users ON userportals.userid = users.userid
      INNER JOIN userroles ON userportals.userid = userroles.userid
      INNER JOIN roles ON userroles.roleid = roles.roleid
      WHERE userportals.portalid = #
  4. When the results are displayed, you can press the Export button (see attached image) and select which type of file you want the results exported to.






1 comment

  • Avatar
    Margo Janosi


    This has been FABULOUS for me to get the information I need; however, I also need to export the information under Profile Settings --> Security , but don't know the table command. 


    Work fabulously - how do I get the security info? Thanks!

    Comment actions Permalink

Please sign in to leave a comment.