As part of our offboarding practice, we offload PST files from Office 365. We've begun to use Veeam for this and are attempting to automate this process using the Powershell module. However there are some annoying inconsistencies in the way that the various commandlets work.
For example:
Code: Select all
$User = Get-ADUser -Identity some.user
Connect-VBOServer
$Organization = Get-VBOOrganization -Name "Some Organization Name"
$Repository = Get-VBORepository -Name "Some Repository Name"
$User = Get-VBOOrganizationUser -Organization $Organization -UserName $User.SAMAccountName
$UserItems = New-VBOBackupItem -User $User -Mailbox -ArchiveMailbox -OneDrive
Add-VBOJob -Organization $Organization -Name $Username -Repository $Repository -SelectedItems $UserItems
This works exactly as expected, and it's very easy to use, clear and concise. Specficially,
Get-VBOOrganizationUser accepts a Username which directly correlates to the
SAMAccountName making this a breeze to use with
Get-ADUser.
However, when I go to perform an export:
Code: Select all
$Session = Start-VBOExchangeItemRestoreSession -LatestState -Organization $Organization
$Database = Get-VEXDatabase -Session $Session
Get-VEXMailbox -Database $Database -Name $Name
I am now expected to use the "display name" of the mailbox. This makes no sense, I should be able to use
Get-VEXMailbox using either a
VBOOrganizationUser object or something like this:
Code: Select all
Get-VEXMailbox -Database $Database -Username $User.SAMAccountName
At the very least, there should be an
Email parameter so that I can search with something like this:
Code: Select all
Get-VEXMailbox -Database $Database -Email $User.EmailAddress
Currently I can
almost do this with the following:
Code: Select all
Get-VexMailbox -Database $Database | Where-Object { $_.Email -eq $User.EmailAddress }
However, since the filtering happens after the entire database worth of mailboxes have been retrieved from the server, it can be painfully slow for large organizations. Additionally, the
Email property of the
VEXMailbox object has a nasty tendency to be the "@onmicrosoft.com" email address (although this may be confined to my specific environment).
Finally, the existence of archive mailboxes causes further issues.
Get-VEXMailbox using
Name won't return the archive mailbox because the name of archive mailboxes are in the format
This means that if I want to get both the standard and archive
VEXMailbox for a user, I have to do something like this
Code: Select all
$User = Get-ADUser -Identity some.user
Get-VEXMailbox -Database $Database -Name @($User.Name, "In-Place Archive - $($User.Name)")
To be blunt, this sucks.
Get-VEXMailbox would preferably return archive mailboxes by default, but I realize that would be a breaking change. A switch parameter like
-IncludeArchive would be a welcome addition. Being able to get a
VEXMailbox by email address should also solve this, as both the regular and archive mailbox have the same email address on the object.
Anyways, hopefully someone sees this who can pass it along. I love the product, but some of the functions leave a bit to be desired.