Migrating Distribution Groups to Office 365, part 1

I am most of the way through a hybrid-mode migration from Exchange 2010 to Office 365. There are a few stages in a hybrid migration. During the process, your on-premises Active Directory database and Exchange directories are synced to the cloud so that mailboxes that have been migrated still appear in the on-premises directory for mailboxes that have not migrated and vice versa. Distribution groups […]

Read Me Leave comment

Convert a HashTable to an Array

Of course, this only works with a single column in the hashtable… Say you have a list of mailboxes in a hashtable, like this: $Mailboxes = Get-Mailboxes -OrganizationalUnit administration But for some reason (It doesn’t really matter why, does it? You just do.) you want a list of their User Principal Names in an array instead of the hashtable. You can do this like so: […]

Read Me Leave comment

Remove Broken ActiveSync Device Partnerships

A user has hit his maximum mobile device count on your Exchange server, but when you try to remove an unused device that hasn’t synced in over a year, you get this error: If you look at the details of the error in the wizard, you’ll notice that the ActiveSyncDevice ID includes the user’s OrganizationalUnit. If you check the user’s current OU, chances are very […]

Read Me Leave comment

Clean Deleted Users from Shared Mailbox Folder Permissions

I don’t know about you, but it really bugs me to see dead accounts in the ACLs of mailbox folders. I wrote this PowerShell script to clean them up whenever I see them. It gets a list of all of the folders in a mailbox, checks each one for any permissions entries where the username = “NT User:S-1*”, and removes those entries, leaving all others […]

Read Me Leave comment

Automatically Delete Old Log Files with a Powershell Script

I use a scheduled task to run a script very similar to this one every midnight to clean up log files on one of my servers. It deletes any files in c:\logs that are more than 30 days old and any files in c:\special\logs that are more than 7 days old. Just change the paths and retention times to suite your requirements. # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # […]

Read Me Leave comment

Running Exchange 2010 PowerShell Scripts Using Task Scheduler

I have a number of complex PowerShell scripts for performing employee onboarding/offboarding, mailbox export request cleanup, and other tasks. Scripts that use the standard cmdlet set, the Active Directory module, or Quest Activeroles AD Management snapin worked fine, but Exchange 2010 and Lync 2010 cmdlets didn’t despite loading the Exchange Management and Lync snapins. Those cmdlets didn’t seem to do anything at all and the […]

Read Me Leave comment

Use PowerShell to manage FullAccess permissions on mailboxes

Every now and then you’ll have a user who has FullAccess to umpteen mailboxes for whatever reason. Cross-forest mailbox migrations, for example. Over time you might lose track of what mailboxes they have access to or why and Outlook starts misbehaving. Shared mailboxes no longer automap in Outlook or they don’t update properly, etc. When you use PowerShell to add FullAccess to another mailbox, you […]

Read Me Leave comment