I have a problem, I need to delete mailbox jobs with more than 200 users backed up in Veeam O365, it's simple to use power shell to delete a single repository user. But when trying to add a csv to bulk delete I get an error.
This is the script I'm trying to use:
Code: Select all
$repository = Get-VBORepository -Name "My Repository"
$users = Import-Csv -Path D:\csv\users.csv
Foreach ($user in $users)
{
$user = Get-VBOEntityData -Type User -Repository $repository -Name $users.DisplayName
Remove-VBOEntityData -Repository $repository -User $user -Mailbox -ArchiveMailbox -confirm:$false
}
Code: Select all
DisplayName,Email
Javier Rugeles,jrugeles@mydomain.com
Code: Select all
Get-VBOEntityData : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Name'.
Specified method is not supported.
At line:3 char:68
+ ... ntityData -Type User -Repository $repository -Name $users.DisplayName
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-VBOEntityData], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Veeam.Archiver.PowerShell.Cmdlets.DataManagement.GetVBOEnt