Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Display Firstname, Lastname, Email, Lastlogon, MailBox size

    Legacy software
    5
    8
    1786
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sbdcunha
      sbdcunha last edited by

      Dear All,

      I need the below details of all my users on my zarafa mail server

      first name , lastname , email id , last log on and mailbox size

      zarafa-admin username gives me the above details but need for all users

      It can be done with a script but i am new babe in scipting…
      really appreciate some one can he help

      regards

      simon

      1 Reply Last reply Reply Quote 0
      • robing
        robing Kopano (Inactive) last edited by robing

        @sbdcunha

        You can user python-kopano for this
        This example should do the trick (not really tested)

        import kopano
        from kopano.errors import *
        from MAPI.Tags import *
        
        for user in kopano.users():
            print("firstname: {}".format(user.prop(PR_GIVEN_NAME_W).value))
            print("Surname: {}".format(user.prop(PR_SURNAME_W).value))
            print("storeid: {}".format(user.store.entryid))
            try:
                print("last logon: {}".format(user.store.prop(PR_LAST_LOGON_TIME).value))
            except NotFoundError:
                print("last logon: never")
            print("mailboxsize: {}".format(user.store.size))
        

        Regards Robin,

        Need support?
        Have a look at https://kopano.com/support/ for options.

        Helpful resources:
        https://kopano.com/blog/how-to-get-kopano/
        https://documentation.kopano.io/
        https://kb.kopano.io/

        1 Reply Last reply Reply Quote 0
        • eli
          eli last edited by fbartels

          Based on zarafa-admin, I’m using the following shell script :

          /usr/bin/showusers.sh

          #!/bin/sh
          #hostname=`hostname` 
          
          if  [ "$1"  =  "all" ] ;  then
              userlist=`zarafa-admin -l | awk '{print $1}'`
            else
              hostname=`hostname`
              userlist=`zarafa-admin -l | grep -i $hostname |awk '{print $1}'`
          fi
          
          for i in $userlist
          do
            zarafa-admin --details $i > /tmp/oneuser.txt 2>/dev/null
            size=`cat /tmp/oneuser.txt | grep "Current store"|cut --delimiter=":" -f 2`
            ll=`cat /tmp/oneuser.txt | grep "Last logon"|cut --delimiter=":" -f 2| cut -c-12`
            ac=`cat /tmp/oneuser.txt | grep "Active"|cut --delimiter=":" -f 2`
            hs=`cat /tmp/oneuser.txt | grep "Home server"|cut --delimiter=":" -f 2`
            echo  "$i \t $size \t $ll \t $hs \t $ac"
          done
          
          1 Reply Last reply Reply Quote 0
          • sbdcunha
            sbdcunha last edited by

            Thanks you so much eli
            I will check it out and let you know

            regards

            simon

            1 Reply Last reply Reply Quote 0
            • sbdcunha
              sbdcunha last edited by

              dear eli,

              I tried to run the script but no file is being creted.
              apprecite if you can help me to debug the scriprt as to where i am going wrong

              thanks and regards

              simon

              1 Reply Last reply Reply Quote 0
              • irrlicht
                irrlicht last edited by irrlicht

                You’re still using old zarafa?

                Pipe the whole script in less

                script.sh | less
                

                quick&dirty:

                for name in $(zarafa-admin -l |sed -n 5,1000p | cut -f 2 | sort)
                do
                        zarafa-admin --details $name > /tmp/details.txt
                        grep Fullname /tmp/details.txt
                        grep size /tmp/details.txt
                        grep Email /tmp/details.txt
                        grep logon /tmp/details.txt     
                done
                
                1 Reply Last reply Reply Quote 0
                • fbartels
                  fbartels Kopano last edited by

                  No need to redirect the output into a file. You could also store the output of zarafa-admin/kopano-admin/kopano-cli in a variable.

                  Regards Felix

                  Resources:
                  https://kopano.com/blog/how-to-get-kopano/
                  https://documentation.kopano.io/
                  https://kb.kopano.io/

                  Support overview:
                  https://kopano.com/support/

                  1 Reply Last reply Reply Quote 0
                  • sbdcunha
                    sbdcunha last edited by

                    Dear Guys,

                    Thank you for you support and help… really apprecite
                    actually when i run the script the /tmp/detials.txt file was just 546 bytes and had only details of 2 usernames but i did a direct of the script itself to a file and it worked just the way i wanted

                    once again thanks a lot

                    regards

                    simon

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post