This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
2
Get-MailboxFolder - how can I get all folders and sub folders and return an object with their info?
Post Flair (click to view more posts with a particular flair)
Post Body
[code]
function Get-MailboxFolder([ref]$flist, $folder)
{
"{0}: {1}" -f $folder.name, $folder.items.count
$flist = $folder.name
foreach ($f in $folder.folders)
{
Get-MailboxFolder $f
}
}
$ol = new-object -com Outlook.Application
$ns = $ol.GetNamespace("MAPI")
$mailbox = $ns.stores | where {$_.ExchangeStoreType -eq 0}
$mailbox.GetRootFolder().folders | foreach { Get-MailboxFolder $_}
[ref]$flist
[/code]
Any suggestions? I canβt seem to get it to continually add to an object and return the object without overwriting it.
Author
Account Strength
100%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
26,663
Link Karma
8,214
Comment Karma
18,430
Profile updated: 4 days ago
Posts updated: 8 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...