PowerShell: Finding Invalid Mailboxes in Exchange

Mailboxes can me marked as invalid in Exchange;  this usually doesn’t affect the day-to-day function of the mailbox (usually) but it will prevent any changes happening to the object (using the standard Exchange tools).  However, whatever is causing those mailboxes to be marked as invalid might cause problems for other systems that use that directory (such as Office 365 or a meta-directory connected system).

To find all the mailboxes which are marked as invalid you can use the following command from an Exchange PowerShell Window;

Get-Mailbox | Where-Object {!$_.IsValid}

You can use the filter on Get-Mailbox to get a subset of data like;

Get-Mailbox -Filter {Office-Like "HQ"} | Where-Object {!$_.IsValid}

Once you’ve got a list invalid mailboxes you can remediate them

 

 

PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing: Part 2

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”

PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing

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 “john@contoso.com:\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.

ie;

$MB=Get-Mailbox Ororo.Monroe

c:\scripts\path\New-FolderPermissionReportObjectArray.ps1 -MailboxToProcess $MB
Continue reading “PowerShell: Export All Exchange Mailbox Folder Permissions In A Format For Further Processing”

PowerShell: Moving SMTP Proxy Addresses to a New Mailbox

I do a lot of work with Exchange and Exchange Online (Office 365).  A common task is to move proxy SMTP addresses from one mailbox to another.  And commonly run tasks must get scripted.

It’s an obscure English by-law.

More detail below.

Continue reading “PowerShell: Moving SMTP Proxy Addresses to a New Mailbox”

PowerShell: Report Mailbox Delegates Script (Office 365 Migration Tool) Part 3

This is the third part (part 1 here and part two here) describing my script that enumerates delegates on mailboxes from a set of users.  This part looks at the second of the two main functions that do all the work as well as the code that ties it all together Continue reading “PowerShell: Report Mailbox Delegates Script (Office 365 Migration Tool) Part 3”

PowerShell: Report Mailbox Delegates Script (Office 365 Migration Tool) Part 2

This is the second part (part 1 here, final part here) describing my script that enumerates delegates on mailboxes from a set of users.  This part looks at the first of the two main functions that do all the work.

Having looked through the script, there may well be better / cleaner ways of doing this;  but I’m publishing this ‘as is’ while remembering writing this on the fly with a curious customer in one ear and a hasty Project Manager in the other 🙂 Continue reading “PowerShell: Report Mailbox Delegates Script (Office 365 Migration Tool) Part 2”

PowerShell: Report Mailbox Delegates Script (Office 365 Migration Tool) Part 1

For these posts I’m going to break down a script I used in anger on a customer site.  I was helping them with an Office 365 migration from on-premise and one of the tasks they wanted help with was planning the order of the migration for their users.

One of the limitations of the migration is that delegate access didn’t work between on-premise and Office 365;  this meant you wanted users with delegate access to mailboxes to be moved with those mailboxes (like a manager with her assistants for example).

They had a large, organically-grown Exchange infrastructure.  This was another way of saying they had no idea who had access to who’s mailbox and also who was a manager of whom.  Time for a bit of PowerShell to save the day. Continue reading “PowerShell: Report Mailbox Delegates Script (Office 365 Migration Tool) Part 1”