10 Replies Latest reply on Feb 2, 2015 6:46 AM by Israel Rodriguez

    This is how user auditing should work in server...

    Mark Jackson

      After getting frustrated that I couldn't copy and paste users in Tableau Server 8, I was able to work out a way to automate user auditing and give my users a way to see who has access to certain project folders (click the image to see it in motion). The main drawback to this approach is the limit on the number of characters you can enter into the project description. If you'd like this to become a default feature of Tableau, vote for the idea here: User Interface for Seeing Who Belongs to a Group

       

      Server Users.Gif

       

      I have a batch file that executes the following command for each group on server:

       

      tabcmd get "/users.xml?fe_group=local%%5CRevenue%%20Cycle%%20Administration%%20Viewers" --filename "\\phcms01\Share_Data\Tableau Data\user_audit_Revenue Cycle Administration Viewers.xml"

       

      This creates a distinct XML file for each group. Then I run the following Ruby script to consolidate all the XML files into a single CSV file that I connect Tableau to (code doesn't paste well):

       

      require 'net/http'
      require 'rexml/document'
      require 'csv'

      groups = [ '0PHC Corp Directors',
      '0PHC Corp Execs',
      '0PHC Corp Managers',
      '2PAH Directors',
      '2PAH Execs',
      '2PAH Managers',
      '3PFH Directors',
      '3PFH Execs',
      '3PFH Managers',
      '4PMH Directors',
      '4PMH Execs',
      '4PMH Managers',
      '5PNH Directors',
      '5PNH Execs',
      '5PNH Managers',
      '6PHI Directors',
      '6PHI Execs',
      '6PHI Managers',
      '6PHI Physicians',
      '7PMCC Directors',
      '7PMCC Execs',
      '7PMCC Managers',
      '7PMCC Physicians',
      'Corporate Directors',
      'Corporate Finance',
      'Corporate PMO',
      'CSS Directors',
      'CV Services Administration',
      'DCIA - Desktop Clinical Intelligence Analysts',
      'Epic Report Writers',
      'Executive Group',
      'Financial Analysts',
      'Financial Planning & Analysis',
      'HR Analytics Content Admins',
      'HR Analytics Users',
      'Labor and Productivity',
      'March Madness Players',
      'Marketing',
      'Medical Records',
      'Patient Financial Services',
      'Patient Financial Services - Content Admins',
      'Physician Outreach',
      'Piedmont Atlanta Administration',
      'Piedmont Atlanta Content Admins',
      'Piedmont Fayette Administration',
      'Piedmont Fayette Content Admins',
      'Piedmont Heart Administration',
      'Piedmont Heart Content Admins',
      'Piedmont Henry Administration',
      'Piedmont Henry Content Admins',
      'Piedmont Mountainside Administration',
      'Piedmont Mountainside Content Admins',
      'Piedmont Newnan Administration',
      'Piedmont Newnan Content Admins',
      'PMCC Administration',
      'PMCC Content Admin',
      'Revenue Cycle Administration Viewers',
      'Revenue Cycle Content Admins',
      'Revenue Cycle Management',
      'SCIA - Server Clinical Intelligence Analysts',
      'Tableau_All'
            ]

      file = '//phcms01/Share_Data/Tableau Data/user_audit.csv'
      fileExists = File.exist?(file)

      if fileExists
         File.delete(file)
      end

      CSV.open(file,"a") do |csv|

         csv << %w{Group User_ID User_Name Email}

         groups.each do |group|

      # get the XML data as a string
      xml_data = File.new("//phcms01/Share_Data/Tableau Data/user_audit_#{group}.xml")

      # extract event information
      doc = REXML::Document.new(xml_data)

      doc.elements.each('users/user') do |ele|

          print "#{group} | #{ele.elements['name'].text} | #{ele.elements['friendly_name'].text} | #{ele.elements['email'].text}\n"
          csv << [
         "#{group}",
         "#{ele.elements['name'].text}",
         "#{ele.elements['friendly_name'].text}",
         "#{ele.elements['email'].text}"
          ]
      end
         end
      end

       

      Finally, I insert the links to the published viz into the project description and use a URL filter to control it:

       

      "Corporate Directors":https://tableau.piedmonthospital.org/views/UserAudit/UserList?Group=Corporate%20Directors&:embed=y - Interactor

      "Corporate Finance":https://tableau.piedmonthospital.org/views/UserAudit/UserList?Group=Corporate%20Finance&:embed=y - Interactor