Maintain control of your Microsoft 365 data
Post Reply
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Exclude OneDrive Folder - syntax

Post by dan.kennedy »

I'm getting a warning for some swf files in a user's OneDrive and after raising a ticket I was told these files are not supported in OneDrive (it's actually the version history which causes Veeam to throw 403 errors). I would therefore like to exclude the entire folder from the job but everything I've tried so far doesn't work!

I've read the Powershell reference with regards to the Add-VBOJob -ExcludedOneDriveFolders switch here: https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=40 but it doesn't actually show the syntax required for excluding a folder - just that it requires a string. Is this just simply a folder name or do i need to enter the entire path?

The error we get in Veeam is below:

Failed to backup item version: /_vti_history/512/Documents/F Drive/Property/Health & Safety/GE700 CITB October 2013/content/F/SWF-CSK-GE700-2012-F01-18.swf, version: 1.0, The remote server returned an error: (403) Forbidden. :: 0:45:41

Could someone please help me out and tell me the correct syntax for excluding the "GE700 CITB October 2013" folder from this backup job so I can stop the warnings?
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exclude OneDrive Folder - syntax

Post by nielsengelen »

You can just use -ExcludedOneDriveFolders "GE700 CITB October 2013"

Example:

Code: Select all

Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

$Org = Get-VBOOrganization -Name "ORG"
$Repo = Get-VBORepository -Name "XYZ"
$ItemsToBackup = New-VBOBackupItem -Organization $Org -OneDrive
Add-VBOJob -Organization $Org -Name "ONEDRIVE BACKUP" -Repository $Repo -SelectedItems $ItemsToBackup -ExcludedOneDriveFolders "GE700 CITB October 2013"
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Re: Exclude OneDrive Folder - syntax

Post by dan.kennedy »

OK thanks so I can just use the folder name as the exclusion - will this then apply to any other users who have that folder in their OneDrive?
Also, does this only work when you add a new job with Add-VBOJob? I was trying to add the exclusion to an existing job with Set-VBOJob - I assume it will still work as the switch is also included with that cmdlet?
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exclude OneDrive Folder - syntax

Post by nielsengelen »

Yes, it can also work with Set-VBOJob. I just made a quick test as an example with Add-VBOJob. This will exclude the folder for all users. If you want this for a specific user then you'll need to make a specific job for them and exclude that user in all other OneDrive jobs.

Keep in mind, it may be useful to contact support to see why we get a 403 on the folders and it may be possible to resolve it without the exclusion. I will leave the call up to you there :-)
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Re: Exclude OneDrive Folder - syntax

Post by dan.kennedy »

I actually raised a ticket previously regarding the swf files (Case ID 03828856) but it got pushed back to Microsoft who then told me swf files aren't actually supported in OneDrive!
Thanks for your help though, I've added the exclusion and will see what happens when the job runs again tonight.
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exclude OneDrive Folder - syntax

Post by nielsengelen »

Ah right, I forgot about the swf rule at Microsoft! I may need more coffee this morning. Keep us posted if all goes well (or not).
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
slackhouse
Influencer
Posts: 15
Liked: 4 times
Joined: May 21, 2018 12:13 pm
Full Name: Jeremy Slack
Contact:

Re: Exclude OneDrive Folder - syntax

Post by slackhouse »

Another way to handle this would be to block that specific file type from being synced by OneDrive in the OneDrive Admin Center. Click Sync -> checking the box for "Block syncing of specific file types", then entering the file type to block (swf). You would still need to do some cleanup for the user who already has these files uploaded. But, that would keep your OneDrive from having unsupported file types in it.
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Re: Exclude OneDrive Folder - syntax

Post by dan.kennedy »

I did suggest we remove the files from the user's OneDrive initially but they are part of some sort of Health & Safety training course that they have to run at different customer sites so they were adamant the files need to stay in OneDrive so they could access them easily! :( The files themselves sync up fine - the only thing that isn't supported by Microsoft with the swf files is version history (which is what i think is causing the error in the backup).

Unfortunately i still got the warning when the job ran last night.
I've double checked the job in Powershell and the folder should be excluded:

$job = Get-VBOJob -Name "****"
Set-VBOJob -Job $job -ExcludedOneDriveFolders "GE700 CITB October 2013"

If i then run $job.ExcludedOneDriveFolders it shows "GE700 CITB October 2013"

But still getting the same error when the job runs....

Processing OneDrive **** (https://****/personal/****_com) finished with warning: Failed to backup item version: /_vti_history/512/Documents/01. ****/Health and Safety/REGS/GE700 CITB October 2013/content/F/SWF-CSK-GE700-2012-F01-16.swf, version: 1.0, The remote server returned an error: (403) Forbidden. :: 0:35:20
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exclude OneDrive Folder - syntax

Post by nielsengelen »

Hi Dan, I suggest to open up a support case for insight why it is being ignored. Logs should be able to help but for now via the forums, it's a bit hard to tell. Could you let me know the support case ID so we can follow it to see what is causing this?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Polina
Veeam Software
Posts: 3195
Liked: 774 times
Joined: Oct 21, 2011 11:22 am
Full Name: Polina Vasileva
Contact:

Re: Exclude OneDrive Folder - syntax

Post by Polina »

Dan,

AFAIR, the specified folder is by default considered to be a root folder. If you need to exclude a subfolder, put a full path to it from the root folder, like this: “Folder A\Folder B”.
Verifying it as I write this (will take a few more minutes), but this is how explicit folder selection works, and it should be the same for exclusions.
dan.kennedy
Service Provider
Posts: 37
Liked: 4 times
Joined: Mar 12, 2019 10:20 am
Full Name: Dan Kennedy
Contact:

Re: Exclude OneDrive Folder - syntax

Post by dan.kennedy »

OK thanks - I just assumed the folder exclusion would be recursive so that might be the problem!

I've changed the folder exclusion to "GE700 CITB October 2013\content\F" so will see what happens when the job runs tonight.
If it still throws the error I will get a ticket raised to figure it out.
Polina
Veeam Software
Posts: 3195
Liked: 774 times
Joined: Oct 21, 2011 11:22 am
Full Name: Polina Vasileva
Contact:

Re: Exclude OneDrive Folder - syntax

Post by Polina »

Sounds like a plan :)

Thanks!
poulpreben
Certified Trainer
Posts: 1025
Liked: 448 times
Joined: Jul 23, 2012 8:16 am
Full Name: Preben Berg
Contact:

Re: Exclude OneDrive Folder - syntax

Post by poulpreben »

Did you ever figure this out? We are on version 5.0.1.207.

I am getting "Item may have a virus reported by the virus scanner plug-in" for the following objects:
  • /personal/user_domain_com/Documents/Folder 1/Folder 2/Network address translation · XYZ's drawings_files/199483d564c61b347c.js.download
  • /personal/user2_domain_com/Documents/Folder 1/Folder 2/Folder 3/outlook/Outlook Express/ANNO 2001.dbx
I have added the following exclusions to the job:

Code: Select all

$job.ExcludedOneDriveFolders
Documents/Folder 1/Folder 2/Network address translation · XYZ's drawings_files
Documents/Folder 1/Folder 2/Folder 3/outlook/Outlook Express
I also tried excluding only the last folder, but it is also ignored. In the previous posts, exclusions are shown with backslash, but they are automatically converted into forward slash when using "Set-VBOJob".
Mike Resseler
Product Manager
Posts: 8191
Liked: 1322 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: Exclude OneDrive Folder - syntax

Post by Mike Resseler »

Preben,

Two things. The notification on those objects means that SharePoint is considering those as potential dangerous objects, and blocks access. So you either remove those files or (depending on the settings) download those files somewhere else.

For the exclusions:

Try it like this:

$folders = @("Folder 1/Folder 2/Network address translation · XYZ's drawings_files", "Folder 1/Folder 2/Folder 3/outlook/Outlook Express")
set-vbojob -job $job -excludedonedrivefolders $folders

Let me know if that works.
poulpreben
Certified Trainer
Posts: 1025
Liked: 448 times
Joined: Jul 23, 2012 8:16 am
Full Name: Preben Berg
Contact:

Re: Exclude OneDrive Folder - syntax

Post by poulpreben »

Hi Mike,

I am aware that it would be best to remove the objects, but as an MSP, it is not always possible to convince your customers to do the right thing ;-)

Removing the leading "Documents" from the exclude path worked. Thanks a lot for pointing this out.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests