Hi,
I really don't know if this could be the same or maybe I am completely wrong, but some time ago I needed to do the same with the email inbox. I needed to create a subfolder inside the inbox/root folder. After some digging I found out, I needed the fetch the ID of the root folder first before I could create a subfolder
A part of the blog ( I still need to publish
😞 )
----------------------------------------------------------------------------------------------------
Most of the script was already published on the internet but I needed it to create a subfolder inside the inbox not in the root of the mailbox. So I changed some parts. Let’s break down what I changed:
To create a subfolder inside the Inbox folder, you will need to ID of the inbox folder. Otherwise it does not work.
$Mailboxfolders = Invoke-RestMethod -Uri $Uri -Headers $Header -Method Get -ContentType "application/json"
$mailboxinboxid = $mailboxfolders.id
Now we have the inbox ID we can change the URI were the subfolder need to be created
"
https://graph.microsoft.com/v1.0/users/$mailbox/mailFolders/$mailboxinboxid/childfolders