Results 1 to 4 of 4

Thread: Creation of Mailboxes via a shell script

Threaded View

  1. #1
    Join Date
    Sep 2011
    Location
    Texas
    Posts
    150
    Rep Power
    4

    Default [SOLVED] Creation of Mailboxes via a shell script

    Has anyone created a shell script similar to what is described below?

    Scenario: An automated windows script creates a comma-delimited list of current users in Active Directory and places it on the Samba share of an Ubuntu / Zimbra server on a daily basis. A cron job runs every hour looking for the file in the samba share.

    Pseudo code for the Ubuntu script:

    Code:
    If /srv/samba/share/adlist.csv Exists
    {
      Move /srv/samba/share/adlist.csv To /temp/adlist.csv
      While Not End of File (/temp/adlist.csv)
      {
        If Not Exist File.UserID in Zimbra
        {
          Create Zimbra Mailbox (File.UserID, File.FirstName, File.LastName, File.Password, DistributionList.Everyone)
          If successful mailbox creation
          {
            Write "Creation of UserID success!" To LogFile
          }
          Else if not successful mailbox creation
          {
            Write "Creation of UserID failed due to error such-n-so" To LogFile
          }
        }
        Read Next Line
      }  
      Delete /temp/adlist.csv
      If LogFile Exists
      {
        Email LogFile to Administrators
      }
    }
    Sample adlist.csv
    Code:
    UserID, FirstName, LastName, Password
    JDoe, John, Doe, abc123
    MJane, Mary, Jane, xyz321
    ArnoldS, Arnold, Swartzensomething, gun4u
    I have found the zmprov command-line documentation to "getAccount" and "createAccount" but I'm not well-versed in unix scripting and file manipulation. Any pointers, examples and whatnot would be appreciated.

    EDIT: In case anyone wants to know, I did get AD Authentication and AD GAL working but it just works better if everything is controlled on the Zimbra side. Therefore, I'm avoiding the direct AD integration and opt'ing for a semi-automated sync.

    Thanks,
    LHammonds
    Last edited by LHammonds; 10-11-2011 at 08:53 PM.

Similar Threads

  1. Replies: 658
    Last Post: 04-04-2014, 09:01 AM
  2. Replies: 0
    Last Post: 07-06-2011, 03:19 AM
  3. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 08:40 AM
  4. From POP3 and 100 scattered mailboxes to Zimbra
    By spiderman in forum Administrators
    Replies: 5
    Last Post: 08-11-2006, 08:00 PM
  5. Massive user creation script
    By castillo in forum Administrators
    Replies: 1
    Last Post: 07-13-2006, 08:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •