PowerShell Quickie: Disable an Exchange Mailbox

powershell_logo.jpg
Though this may very well be the shortest PowerShell Quickie that I could ever post, it might also be one of the most useful. Exchange administrators often have the need to disable a user’s mailbox for one reason or another, but having to use the GUI tools isn’t always the best use of time. Need to disable a user’s mailbox quickly from the command line? One very short line will do it:

Disable-Mailbox <mailboxID>

PowerShell Quickie: Disable ActiveSync for All Mailboxes

powershell_logo.jpg
By default, the ActiveSync protocol is enabled for all users in an Exchange organization, whether or not they even have a mobile device. As a security precaution, you may want to disable the protocol for all mailboxes, and enable it only for select users. The following PowerShell Quickie will disable ActiveSync for all existing mailboxes:

get-Mailbox | set-CASMailbox -ActiveSyncEnabled:$False

Don’t forget to go back and enable ActiveSync for any user that needs it!

New Feature: PowerShell Quickies

powershell_logo.jpg
With the introduction of Windows Server 2008, more and more administrators are being introduced to the Windows PowerShell; Microsoft’s new command line shell and task-based scripting technology. Since the command line is sometimes a foreign concept to many Windows administrators, I would like to introduce a new series of “PowerShell Quickies.”

Every few days, I’m going to attempt to demonstrate a script or one-liner for a commonly performed task. I have quite a few already lined up for Windows Server, Active Directory, and Exchange and will post new ones as often as possible. Anybody have any special requests?