Maintain control of your Microsoft 365 data
Post Reply
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Trry to figure out excludeonedrivefolders syntax powershell

Post by Peejay62 »

Hi,

I've been trying to figure out what the exact syntax is for defining a onedrive folder that needs to be excluded. I tried various definitions, none worked. How is a onedrive path seen within VBO? Browsing a backup I see an url mentioned for a directory. Is that url also to be considered as the path for that directory and can be given within excludeonedrivefolders? I suspect no as this didn't seem to work.
I really like to exclude some generic directories for backuprocessing of our onedrives and thus want to solve this by using excludeonedrivefolders. knowing how to define the folders would be more than welcome,

thanks, Peter
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by nielsengelen »

You can just use folder names in it and they will be excluded.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Natalia Lupacheva
Veteran
Posts: 1143
Liked: 302 times
Joined: Apr 27, 2020 12:46 pm
Full Name: Natalia Lupacheva
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by Natalia Lupacheva »

Hi Peter,

In addition, if you are looking for the example, you may take a look at this thread.

Thanks!
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by Peejay62 »

Well, I tried foldernames (various ways), no success.. Also looked at that other thread and it didn't help me either. I suspect the real folder(name) is different than it is visually presented by explorer. When I browse a backup I see a path (url) for a folder that is being backed up as : personal/somename/documents/testfolder. So this was a onedrive backup for "somename" for whom I'd like to exclude the testfolder. I can continue trying to find the correct path definition but maybe you can put me in the right direction for that..

thanks!
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by nielsengelen »

If this is a subfolder, you should use documents\testfolder normally to exclude it. Did you try this already?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by Peejay62 »

Hi Niels,

I did that, didn't work. created a complete new job to backup my onedrive. No other backup present for me. Added folderexclusion (2 folders):
....
$folders="documents\testfolder,documents\Googlechrome"
set-vbojob -job $job -excludedonedrivefolders $folders
...

ran the job, did as expected full, both folders are being backed up, so not excluded...

regards, Peter
Mike Resseler
Product Manager
Posts: 8191
Liked: 1322 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by Mike Resseler »

Peejay62,

Can you try it like this:

$folders = @("test", "test2", "test3")
Peejay62
Expert
Posts: 235
Liked: 37 times
Joined: Aug 06, 2013 10:40 am
Full Name: Peter Jansen
Contact:

Re: Trry to figure out excludeonedrivefolders syntax powershell

Post by Peejay62 » 1 person likes this post

Hi Mike,

I tried that. That also didn't work (at first). To keep figuring out I changed to "selectedonedrivefolders" for trying to select just 1 folder. Put in a variety of notations for folders and succeeded in backup of one folder.
It seems to be the case that "documents" also belongs to the rootpath. So in order to select the folders "testfolders and Googlechrome" the folderarray needs to be $folders=@("testfolder", "Googlechrome")
Well, my problem is solved, I now can exclude folders that I don't want to backup out of MS365.

thanks, Peter
Post Reply

Who is online

Users browsing this forum: glwschwarz and 21 guests