I'm having a problem filtering out mailboxes when there are two people with the same name.
So I would normally run a command like this:
Code: Select all
$mailbox = Get-VEXMailbox -Database $database -Name "Joe Bloggs"
Id : 4460fb58-34cf-488c-8cb2-f17721788a26
Name : Joe Bloggs
Email : joe.bloggs@company.com
IsDeleted : False
IsArchive : False
Id : a59e4551-b367-499e-84c7-1159459be40e
Name : Joe Bloggs
Email : joebloggs@company.com
IsDeleted : False
IsArchive : False
Which means when I run this command:
Code: Select all
Get-VEXFolder -Mailbox $mailbox
Get-VEXFolder : Cannot convert 'Joe Bloggs Joe Bloggs' to the type 'Veeam.Exchange.PowerShell.Model.Items.VEXMailbox' required by parameter 'Mailbox'. Specified
method is not supported.
At line:1 char:24
+ Get-VEXFolder -Mailbox $mailbox
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-VEXFolder], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Veeam.Exchange.PowerShell.Cmdlets.Items.GetVEXFolder
I've tried to filter out the one I want with this command, using Where-Object:
Code: Select all
$mailbox = Get-VEXMailbox -Database $database -Name "Joe Bloggs" | Where-Object {$_.Email -eq "joebloggs@company.com"}
Code: Select all
$mailbox = Get-VEXMailbox -Database $database -Name "Joe Bloggs" | Where-Object {$_.Id -eq "a59e4551-b367-499e-84c7-1159459be40e"}
Am I missing something obvious here?
Thanks!