Detect File Attribute for files on demand (PINNED/UNPINNED)

Marco Scheel

We try to work with the attributes of files in OneDrive for Business on Windows 10 (1709). This article ha a great overview:


This is a link that documents the attributes flags:



I don't find an exact representation of the pinned and unpinned attribute:

C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer> attrib /?
Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [+O | -O] [+I | -I] [+X | -X] [+P | -P] [+U | -U]
[drive:][path][filename] [/S [/D]] [/L]

+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
O Offline attribute.
I Not content indexed file attribute.
X No scrub file attribute.
V Integrity attribute.
P Pinned attribute.
U Unpinned attribute.
B SMR Blob attribute.
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.
/L Work on the attributes of the Symbolic Link versus
the target of the Symbolic Link


We want to interact with the files in C and/or C#.


This is a sample directory with files and the three states: screen.png

This is a LS on a folder with different files

Directory: C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-----l      XX.XX.XXX     11:09        5386058 o365api.pbix
-----l      XX.XX.XXX     21:25          18325 test.docx
-----l       XX.XX.XXX 16:25      (3631219) When-To-Use-What-In-Office-365.pdf
This is the attribute as an int:
C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer> get-item *.* | % { $_.Attributes }
C:\Users\marcoscheel\OneDrive - Glück & Kanja Consulting AG\Transfer> get-item *.* | % { [int]$_.Attributes }
The system is capable to represent the cloud only file as a ReparsePoint, but the pinned and unpinned file are not matched. Is there an offical documentation regarding these "missing" flags.
Related Conversations