Monday 26 January 2009

Set-CASMailbox

I think this is one of the most annoying cmdlets in Exchange 2007. I recently attempted to use this cmdlet to disable the Change Password window in Outlook Web Access for a lot of mailboxes that were going to have their password set via a 3rd party synchronisation tool. It has been some months since I had last run Set-CASMailbox and had forgotten about it's sledgehammer approach. Basically if you set just about any of the segmentation attributes to $false, it sets them all (beginning OWA....) to $false also. (Thank goodness that was on my test rig...)

Here is a list of all OWA Segmentation attributes that will get set to $false by running the command Set-CasMailbox BGibson OWAChangePasswordEnabled $false ;

OWACalendarEnabled : False
OWAContactsEnabled : False
OWATasksEnabled : False
OWAJournalEnabled : False
OWANotesEnabled : False
OWARemindersAndNotificationsEnabled : False
OWAPremiumClientEnabled : False
OWASpellCheckerEnabled : False
OWASearchFoldersEnabled : False
OWASignaturesEnabled : False
OWAThemeSelectionEnabled : False
OWAJunkEmailEnabled : False
OWAUMIntegrationEnabled : False
OWAWSSAccessOnPublicComputersEnabled : False
OWAWSSAccessOnPrivateComputersEnabled : False
OWAUNCAccessOnPublicComputersEnabled : False
OWAUNCAccessOnPrivateComputersEnabled : False
OWAActiveSyncIntegrationEnabled : False
OWAAllAddressListsEnabled : False
OWAChangePasswordEnabled : False
OWARulesEnabled : False
OWAPublicFoldersEnabled : False
OWASMimeEnabled : False
OWARecoverDeletedItemsEnabled : False


That's right, if you set one to $false you set them all to $false unless you explicitly remember to list every other attribute and set them all to $true in the command.

Thankfully there is a quick fix to reverse this action. Open ADSIEdit.msc and browse to the affected AD user account(s). Select the user properties and find the msExchMailboxFolderSet attribute. Clear any value in this attribute (i.e. ) and the OWA Segmentation properties will all be set back to default.

So how do you set one OWA Segmentation attribute then?
You can either list all the attributes above as $true, except the one you want to set as false. Or you can use ADSIEdit to set all attributes to $True by setting the msExchMailboxFolderSet value to 2147483647 and then change the one attribute you want to disable using the Set-CASMailbox cmdlet again.

1 comment:

Given To Fly said...

Why not use ADModify.Net. It at times is much easier to use and accomplish the objective than powershell by using this tool and you don't have to remember gotchas. It can also be a life-saver if you try it with rollback option.