Exclude a folder or file from being synced by OneDrive

I have discovered that this option no longer works on the latest versions of OneDrive. The only exclusion functionality currently available is "exclusion of file extensions", which is rarely useful.
  1. Open directory C:\Program Files\Microsoft OneDrive\[Version]\adm or %localappdata%\Microsoft\OneDrive\[version]\adm\
  2. Copy the OneDrive.admx file to C:\Windows\PolicyDefinitions
    1. And OneDrive.adml file to C:\Windows\PolicyDefinitions\en-US
  3. Start gpedit.msc (a Local Group Policy Editor)
  4. Navigate to LCP\Computer Configuration\Administrative Templates\OneDrive
  5. Find & open Exclude specific kinds of files from being uploaded
    1. Enable
    2. Show
    3. Enter exclusion names with only asterisks available as wildcards
For example, enter *.pst to block all files with the .pst extension. Enter expense* to block files that have names beginning with "expense". And so on.

Files that are not synchronised, are going to look like this:

Credits to Christian Brinkhoff

Learn how to exclude files and extensions in Windows 365 cloud PCs from syncing in to OneDrive via both GPOs and Microsoft Endpoint Manager
If I asked you this question 2 years ago; do you use OneDrive on your virtual desktop – Cloud endpoint environment, you most likely would answer this question with no. This was mainly due to the lack of alignment of the OneDrive product for virtualization scenarios. Luckily, this changed, and the wo…