{"id":1678,"date":"2021-10-25T12:00:00","date_gmt":"2021-10-25T12:00:00","guid":{"rendered":"http:\/\/neu.koetzingit.de\/richtig-microsoft-onedrive-in-vdi-umgebungen-nutzen\/"},"modified":"2026-06-02T17:20:26","modified_gmt":"2026-06-02T17:20:26","slug":"richtig-microsoft-onedrive-in-vdi-umgebungen-nutzen","status":"publish","type":"post","link":"https:\/\/www.koetzingit.de\/en\/richtig-microsoft-onedrive-in-vdi-umgebungen-nutzen\/","title":{"rendered":"Using Microsoft OneDrive correctly in VDI environments"},"content":{"rendered":"<p><span class=\"dropcapmiddle\">M<\/span>icrosoft OneDrive is part of Office 365 and is increasingly being used by companies. This article is about how Microsoft OneDrive can be used in virtual desktop infrastructures (VDI). The focus of the article is on <strong>Multi-user environments<\/strong> with Server 2019 or Windows 10 VWD, but it can also be used in other scenarios.<\/p>\n<p>OneDrive can save the user profile <strong>grow very quickly<\/strong> and requires more local or on-prem storage capacity. In addition, users change end devices frequently, which again has an impact on the <strong>Registration times<\/strong> has. I would like to explain in more detail below how to use OneDrive correctly in VDI environments.<\/p>\n<p><!--more--><\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"label label-success\">Microsoft OneDrive problem in VDI environments<\/span><\/h3>\n<p>Let's start with the fact that OneDrive was developed for single-user systems and not for multi-user systems, which is a problem in itself. VDI environments are normal these days and understandably companies want to use OneDrive on these desktops. OneDrive synchronizes data between the user device and the Microsoft Cloud, but nothing more. Moving customers <strong>all your data<\/strong> to the Microsoft Cloud in order to <strong>Storage capacity requirement<\/strong> in your own data center. Initially, OneDrive synchronized all of the user's data or selected data to the user's device.<\/p>\n<p>In this way, however, the data is returned to the company, only distributed across different end devices. In a VDI environment, the data is stored in the user's profile and then finally on a storage system in the data center. So nothing is gained, except that the data is now more distributed.<\/p>\n<p>Microsoft has recognized this problem and has thus developed the \u201e<strong>Files on demand<\/strong>\u201c has been introduced. With \u201eFiles on demand\u201c, no data is synchronized automatically, but only when the user needs it. This is great, as it reduces the amount of data and prevents it from ending up in the data center. However, users can quickly request all data and thus \u201einflate\u201c the profile again and thus require storage space in the data center. To ensure that the login is still fast with the profile sizes <strong>virtual disks used<\/strong> as with FSlogix or Citrix UPM container disks. Nevertheless <strong>Storage capacity required<\/strong> and that's exactly what you didn't want. By the way, \u201eFiles on demand\u201c requires Server 2019 or Windows 10 with the new file attributes for cloud content.<\/p>\n<p>Another piece of the puzzle to solve the problem is Microsoft Storage Sense. With Storage Sense, cloud content is automatically shared, i.e. deleted locally but remains in the cloud. The same process works with OneDrive and right-clicking on a file. Here there is then the item \u201e<strong>Free up storage space<\/strong>\u201c and thus also deletes the file locally.\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1676\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"http:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/Onedrive-freigeben.jpg\" alt=\"Onedrive Freigeben\" width=\"318\" height=\"129\"  title=\"Using Microsoft OneDrive correctly in VDI environments\" srcset=\"https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/Onedrive-freigeben.jpg 318w, https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/Onedrive-freigeben-300x122.jpg 300w\" sizes=\"auto, (max-width: 318px) 100vw, 318px\" \/><\/p>\n<p>With Server 2019, the per-user Storage Sense policies must be configured via Powershell (later via GPO). The minimum for cloud content before it is released is one day, but the cleaning process of the system also runs at least once a day.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1677\" style=\"display: block; margin-left: auto; margin-right: auto;\" src=\"http:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/StorageSense-OneDrive-boarder.jpg\" alt=\"StorageSense OneDrive Boarder\" width=\"650\" height=\"204\"  title=\"Using Microsoft OneDrive correctly in VDI environments\" srcset=\"https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/StorageSense-OneDrive-boarder.jpg 650w, https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/StorageSense-OneDrive-boarder-300x94.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/p>\n<p>In VDI environments, the<strong> again a problem<\/strong>! The cleaning process only runs once a day and nobody knows when! With users who may log on and off several times a day, it can be difficult to know exactly when the cleanup is running. This means that it may never run for users or, when it does finally run, the virtual disk may have grown so much that it has to be compressed again.<\/p>\n<p>In the end, we used Storage sense and files if required <strong>nothing gained<\/strong>. Now the folder or content of OneDrive could simply be deleted completely when logging out or simply not taken along, e.g. via the FSLogix redirection.xml. However, I have to advise against this, as it is not possible when starting <strong>OneDrive often crashes<\/strong> of the application.<\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"label label-success\">The OneDrive VDI workaround<\/span><\/h3>\n<p>What would be necessary for VID environments is for Storage Sense to carry out the cleaning process when the user logs out, thereby releasing all cloud content. Unfortunately, this is currently not an option with Storage Sense. There should be a Storage Sense option like: \u201e<strong>Sharing files when logging out<\/strong>\u201c and not only after one day. There are instructions to execute the following command\u00a0<code>cleanmgr.exe \/autoclean \/d,<\/code> to share files, but this does not work on a per-user basis.<\/p>\n<p>The solution is to run a Powershell script on logoff, and it doesn't even require Storage Sense to be configured! The script goes through the user's entire OneDrive folder and releases downloaded cloud content. This does not include files that have been marked to remain on the device or URL files. This means that the files are no longer in the profile and keeps the amount of data to an absolute minimum. This is exactly what is needed in a VDI environment. In addition, no exceptions or anything else needs to be configured for OneDrive.<br \/>The disadvantage is a possible short-term increase in CPU usage when the script is executed. Also, no FSLogix Office Container can be used, as this extra disk is immediately disconnected when logging off and the script will not find any folder or content from OneDrive.<\/p>\n<p>The Powershell script can be executed via Microsoft Group Policy or via Citrix Workspace Environment Manager version 1912 on logoff. The <strong>Download link<\/strong> The Powershell script can be found at the end of the article.<\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"label label-success\">The mysterious OneDrive problem<\/span><\/h3>\n<p>Even after several years and even outside of VDI environments, there is still an unsolved OneDrive problem! For still unknown reasons, OneDrive data is being deleted as if by \u201emagic\u201c.\u201c <strong>deleted or moved to the trash<\/strong> moved. Some users report that thousands of files have suddenly been deleted and then have to be laboriously restored online. As the problem is not reproducible, Microsoft is also finding it incredibly difficult to rectify this error. If there is a solution, I would be very interested in it!<\/p>\n<p>\u00a0<\/p>\n<h3><span class=\"label label-success\">PowerShell Download Link<\/span><\/h3>\n<p>The download is only possible with your name and e-mail address. If you do not wish your data to be saved, simply send me an e-mail or do not download the file.<\/p>\n<p><strong>Download<\/strong>:\u00a0<a title=\"free-up-space.ps1\" href=\"https:\/\/github.com\/Koetzing\/Powershell-Scripts\/blob\/main\/free-up-space.ps1\" target=\"_blank\" rel=\"noopener noreferrer\">free-up-space.ps1<\/p>\n<p><\/a><\/p>\n<p>Let me know what you think about my way of using OneDrive!<\/p>","protected":false},"excerpt":{"rendered":"<p>Microsoft OneDrive ist Teil von Office 365 und wird immer h\u00e4ufiger von Unternehmen eingesetzt. In diesem Artikel geht es darum, [&hellip;]<\/p>\n","protected":false},"author":1755,"featured_media":1675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[27,277,250,279,32,278,42,274,182,206,275,276,83],"class_list":["post-1678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles-de","tag-citrix","tag-cloud","tag-fslogix","tag-m365","tag-microsoft","tag-o365","tag-office","tag-onedrive","tag-profile","tag-upm","tag-vdi","tag-vwd","tag-xenapp"],"uagb_featured_image_src":{"full":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo.png",360,360,false],"thumbnail":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo-150x150.png",150,150,true],"medium":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo-300x300.png",300,300,true],"medium_large":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo.png",360,360,false],"large":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo.png",360,360,false],"1536x1536":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo.png",360,360,false],"2048x2048":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo.png",360,360,false],"trp-custom-language-flag":["https:\/\/www.koetzingit.de\/wp-content\/uploads\/2021\/10\/OneDrive-Logo.png",12,12,false]},"uagb_author_info":{"display_name":"Thomas K\u00f6tzing","author_link":"https:\/\/www.koetzingit.de\/en\/author\/thomas-koetzing\/"},"uagb_comment_info":2,"uagb_excerpt":"Microsoft OneDrive ist Teil von Office 365 und wird immer h\u00e4ufiger von Unternehmen eingesetzt. In diesem Artikel geht es darum, [&hellip;]","_links":{"self":[{"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/posts\/1678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/users\/1755"}],"replies":[{"embeddable":true,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/comments?post=1678"}],"version-history":[{"count":2,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/posts\/1678\/revisions"}],"predecessor-version":[{"id":1940,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/posts\/1678\/revisions\/1940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/media\/1675"}],"wp:attachment":[{"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/media?parent=1678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/categories?post=1678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.koetzingit.de\/en\/wp-json\/wp\/v2\/tags?post=1678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}