question

lovelyt-1922 avatar image
0 Votes"
lovelyt-1922 asked AllenXu-MSFT commented

How to get the custom column values of the folders in a library in powershell ?

I have to update the properties of files in the folders in a document library.

The document library has two column "EmployeeID" , "Country" columns . The folders have the values for these columns. Now I have to update the properties of the files underneath these folders with folders column values.

How can I do this in powershell ? Please let me know.

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered AllenXu-MSFT commented

Hi @lovelyt-1922 ,

As Microsoft hasn't provided any API(Folder methods , Folder properties) for us to access custom fields of a folder, as per my knowledge your requirement may be unable to be achieved by using PowerShell.

I'm afraid you have to iterate all files in a folder and assign values to them folder by folder. Please take a reference to the following two articles:
SharePoint Online: PowerShell to Iterate Through All Files in a Document Library
SharePoint Online: Update Metadata of a Document using PowerShell


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@lovelyt-1922 ,

Is there any update on this thread? I'm looking forward to your reply.

If an answer is helpful to you ,please don't forget to accept it as answer :-)

0 Votes 0 ·