We use cookies on our website to ensure we provide you with the best experience on our website. By using our website, you agree to the use of cookies for analytics and personalized content.This website uses cookies. More Information
It seems like your browser didn't download the required fonts. Please revise your security settings and try again.

Attention

Starting May 1st, 2018, we will no longer offer the ArchiveOne family of products. This includes all editions of ArchiveOne, ArchiveOne for Files, Max Compression, and Access Security Manager. If you currently hold a maintenance and support contract, you will continue to receive our award-winning support until your contract expires, or until May 1st, 2019, whichever occurs first. The license for ArchiveOne is perpetual; therefore the software may continue to be used independently without any updates or support indefinitely.

How to Use Scripting to Automatically Populate Mailbox Manager

  • Last updated on

Section 1. Barracuda ArchiveOne Version 7.0 and Higher.

This section assumes you have some scripting skills and a familiarity with PowerShell and Active Directory (AD).

You can auto-populate the list of users/mailboxes in the ArchiveOne Mailbox Manager node. This is useful if your organization has a large number of users or have numerous users that join/leave the organization. Instead of managing users in the ArchiveOne Admin console, you can add or remove users from AD groups or organizational units (OUs). In the latest version of ArchiveOne, the integration framework is compiled with .NET v4.5. You can use PowerShell, or another .NET v4 compatible language to script the Mailbox Manager population.

The following steps describe a standard approach to populating the Mailbox Manager:

  1. Create a Mailbox Manager object.

  2. Populate the Mailbox Manager with all users in the AD groups and OUs you want to include in the Mailbox Manager.

  3. For each user, update or insert the user into the Mailbox Manager using the API.

For example, in PowerShell:

Add-type -path "C:\Program Files (x86)\Barracuda\ArchiveOne\SDK\C2CSystems.ArchiveOne.Policy.dll"
$mailboxManager = New-Object "C2CSystems.ArchiveOne.Policy.MailboxManager"
$objOU = Get-ADUser -SearchBase "CN=Users,DC=whatever,DC=com" -Filter *
ForEach($objUser in $objOU)
 {
  if($objUser.UserPrincipalName -ne "")
  {
   $mbID = $mailboxManager.GetID($objUser.UserPrincipalName)
   if(($mbID -ne $null) -and ($mbID -ne ""))
   {
    $mb = $mailboxManager.CreateMailbox($mbID)
    $mb.Enabled = $true
    $mb.RepositoryName = "Year_2016"
    $mb.CreateSearchFolder = $true
    if(!$mb.AddSearchUser($objUser.UserPrincipalName))
     {
      "Could not add " + $objUser.Name + " as a search user"
     }
    if($mailboxManager.UpdateMailbox($mb))
    {
     "Successfully added user : " + $objUser.Name
    }
   else
   {
    "Failed to add user : " + $objUser.Name
   }
  }
 }
}

Section 2. Barracuda ArchiveOne Version 6.6 and Earlier 

This section assumes you have some scripting skills and a familiarity with VBScript and AD. For more information on the API used, open the SDK folder in the installation directory, by default C:\Program Files (x86)\Barracuda\ArchiveOne\SDK.

Alternatively, you can download the sample script ActiveDirectoryIntegration.txt.

In older versions of ArchiveOne, VBScript can be used.

Keep a list of any users that cannot be inserted into the Scripting Dictionary.

  1. Create a Scripting Dictionary object.
  2. Populate the Scripting Dictionary with all users in the AD groups and OUs you want to include in the Mailbox Manager.
  3. For each user listed in the Scripting Dictionary, update or insert the user into the Mailbox Manager using the API.

For example:

Set objDic = CreateObject("Scripting.Dictionary")
Set objFail = CreateObject("Scripting.Dictionary") 
Set objOU = GetObject("LDAP://OU=Users,DC=domain,DC=com") 
For each objMember in ObjOU 
  Select Case LCase(objMember.Class) 
    case "user" 
      If not(objDic.Exists(LCase(objMember.distinguishedName))) Then 
        objDic.Add LCase(objMember.distinguishedName), objMember 
      End If 

    case else 
 ' do nothing it was not a user object 
   End Select 
Next 

 ' Now update the users into Mailbox Manager 
Dim myArray, mb, mbm, mbID 
Set mbm = CreateObject("C2CSystems.ArchiveOne." & sApp & ".MailboxManager") 

For Each obj In objDic.Keys 
   Set objUser = objDic.Item(obj) 
   mbID = mbm.GetID(objUser.distinguishedName) 
   Set mb = mbm.CreateMailbox(mbID) 
   mb.Enabled = True 
   mb.RepositoryName = "My repository" 
   mb.CreateSearchFolder = true 
   mb.AddSearchUser objUser.distinguishedName 

   If Not(mbm.UpdateMailbox(mb)) Then 
     objFail.Add LCase(objUser.distinguishedName), objUser 
   End If 
Next 

 ' do something with objFail if needed 
Set mb = Nothing 
Set mbm = Nothing



Last updated on