This is an update to my function to extract Mailbox folder permissions as PowerShell objects, allowing various forms of processing.
The main script is here.
In this update I’ve made the function skip some default folders it can’t process, treat the root of the mailbox better and improved the logging.
Continue reading “PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing: Part 2”
The following is a simple script to generate a mailbox size report CSV for a set of email addresses. The full function and explanation follows.
Continue reading “PowerShell: Create a CSV Report of Mailbox Sizes”
Within Exchange (on-premise or Online) it’s sometimes helpful to export the delegate permissions that a user can set within their mailbox. Get-MailboxFolderPermission is the cmdlet which will export that information for a particular folder. The identifier needs to be in the format “firstname.lastname@example.org:\Marketing\Reports”.
That said there’s not an easy way to export the permissions on ALL folders within a mailbox and the output for that command isn’t very helpful for further processing.
So; script. It’ll take a mailbox as a parameter and output the permissions on all the mailbox folders (and subfolders) as objects.
I wrote a post about the initial version of the script and how it works in Part 1 here.
The first update, allowing the function to deal with special folders and the root better is here (Part 2).
I’ve also made the script stand-alone now (rather than a function). So just save this as a .ps1 file and run it with the MailboxToProcess parameter and it will work.
c:\scripts\path\New-FolderPermissionReportObjectArray.ps1 -MailboxToProcess $MB
Continue reading “PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing”
With the outcry caused by the BBC removing the BBC food section from their website and the rush of people trying to mirror it or download the data I thought; just how would you do that with PowerShell?
(Of course, if you’re not interested in re-inventing the wheel Wget does this much better)
After a bit of thought I came up with the following requirements;
- It would need to recursively call itself going through all the links on the page.
- These should be filtered so I only get the pages matching a particular sub page (in the bbc example we only want the /food ones).
- It should download the pages and try and keep a representation of the hierarchy (so /food/recipies/cucumber.html is saved to \food\recipies\cucumber.html on the disk).
- I’m not interested in fixing the links yet; as long as we get a copy it should be fine.
- We need someway to terminate the recursion so it doesn’t keep processing the same pages. It also needs to only process each page once.
So a vague loop would be to go to a web page, go to all the links matching the sub page we want, output them to disk and record the page name to a list to make sure we don’t visit it again. You’d end up with a nice folder full of file versions of the website.
Invoke-WebRequest is good for this; it gets the web page content but also puts all the links from the page in a handy property of the object. Easy to enumerate through!
The script and detail are after the break.
Edit: I had another pass at this script and optimised it a bit here. Continue reading “PowerShell: Archiving All The Web-Pages on A Site (Example: bbc.co.uk/food)”
Hi. Last week a customer asked me find out which mailboxes had eaten all the pies on a particular Exchange server; getting a list of the largest mailboxes and whether they were in a disconnected state (already removed and waiting purge).
To get an accurate picture I needed to take into account the deleted items in the mailbox as well. It’s a small command but it’s got a few squirrelly bits I’ll go into as well after the line. Continue reading “PowerShell: Get Largest Mailboxes on an Exchange Server (One-Line Command)”
One of the many Sisyphean tasks my wife performs is keeping the all the metadata tags of our digital photographs up to date. She meticulously keeps tabs on the tags she’s used but with the sheer number of photos, new photos being added and the children starting to take photos too it’s a pretty time-consuming task.
So; what she needs is a list of all the tags used on each picture file (including ones missing with tags) in an easily sortable format.
Being the caring husband that I am I started spending some time solving that problem with PowerShell.
Of course, she might have been happier with me doing all the ironing for a week so she can focus fully on sorting the pictures out but this is a) more efficient and b) a solution that she can re-use (teach a woman to (photograph) fish etc) and so is a better use of our time.
At least, that’s my excuse and I’m sticking to it. Continue reading “PowerShell: Querying, Formatting and Exporting Tags on Picture Files”