Oct 30 2022 10:39 AM
Hello All,
I've connected to MgGraph using an AccessToken and this access token has read,writeAll permissions on all mail folders throughout the business.
I have roughly 400 users that I need a folder removed from their Outlook. The folder name is "Promo"
Import-csv pathToFile.csv |foreach { {get-MgUserMailFolder -UserId $_.PrimarySmtpAddress -Filter "Displayname eq 'Promo'"} ==>Works. I can see all of the ID and displayName.
When I pipe it to remove it is complaining that "The variable '$_' cannot be retrieved because it has not been set"
Oct 31 2022 12:06 PM