Maintain control of your Microsoft 365 data
Post Reply
Frank_190
Influencer
Posts: 20
Liked: 4 times
Joined: Feb 21, 2017 9:47 pm
Full Name: Frank Pisano
Contact:

Powershell Error with Remove-VBOEntityData

Post by Frank_190 »

I am trying to remove some former employees from my Office 365 repository via PowerShell. I opened a support ticket, 03315036, and they say they don't help on powershell scripts. I am running into the following error.

PS X:\Backup> $user = Get-VBOEntityData -Type User -Repository $repository -Name "John Doe"
PS X:\Backup> Remove-VBOEntityData -Repository $repository -User $user -Mailbox -ArchiveMailbox -OneDrive -Sites -WhatIF

Remove-VBOEntityData : Cannot convert 'System.Object[]' to the type
'Veeam.Archiver.PowerShell.Cmdlets.DataManagement.VBOUserData' required by parameter 'User'. Specified method is not
supported.
At line:1 char:52
+ Remove-VBOEntityData -Repository $repository -User $user -Mailbox -ArchiveMailbo ...
+ ~~~~~
+ CategoryInfo : InvalidArgument: (:) [Remove-VBOEntityData], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Veeam.Archiver.PowerShell.Cmdlets.BackupItems.RemoveVBOEntityData



What I think is the issue is that we have for most older employees, two entries when we issue the following command:
$user = Get-VBOEntityData -Type User -Repository $repository -Name "John Doe"

If I do a write $user I will get the output twice on an older employee, but on a brand new employee, I only get one group of returns.

Any suggestions on what might be causing this error?

Thank you
nielsengelen
Product Manager
Posts: 5619
Liked: 1177 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Powershell Error with Remove-VBOEntityData

Post by nielsengelen » 2 people like this post

Can you try the following (I don't have double entries so I can't test it):

Code: Select all

$users = Get-VBOEntityData -Type User -Repository $repository -Name "John Doe"

foreach ($user in $users) {
   Remove-VBOEntityData -Repository $repository -User $user -Mailbox -ArchiveMailbox -OneDrive -Sites -WhatIF
}
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Frank_190
Influencer
Posts: 20
Liked: 4 times
Joined: Feb 21, 2017 9:47 pm
Full Name: Frank Pisano
Contact:

Re: Powershell Error with Remove-VBOEntityData

Post by Frank_190 »

That did the trick! Thank you very much for the help.
eros.rodigari
Lurker
Posts: 2
Liked: 1 time
Joined: Mar 03, 2023 9:25 am
Full Name: Eros Rodigari
Contact:

Re: Powershell Error with Remove-VBOEntityData

Post by eros.rodigari »

Thank you nielsengelen, this is the version of your script that i used in agreement with veeam support. (without trailing -WhatIF)

Code: Select all

$repository = Get-VBORepository -Name "YOUR REPOSITORY NAME"
$users = Get-VBOEntityData -Type User -Repository $repository -Name "NAME OR EMAIL ADDRESS"
ForEach($user in $users){
Remove-VBOEntityData -Repository $repository -User $user -Mailbox -ArchiveMailbox -OneDrive -Sites
}
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests