Section 1. Barracuda ArchiveOne Version 7.0 and Higher.
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:
Create a Mailbox Manager object.
Populate the Mailbox Manager with all users in the AD groups and OUs you want to include in the Mailbox Manager.
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
In older versions of ArchiveOne, VBScript can be used.
- Create a Scripting Dictionary object.
- Populate the Scripting Dictionary with all users in the AD groups and OUs you want to include in the Mailbox Manager.
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