Friday, December 4, 2015

Prevent Users from Changing Photo in OWA

Using Outlook Web App (OWA, or Outlook on the Web as it is now known), users can change/update their photo using two methods:
1.    By clicking on the Display Name (Exchange 2013) or user photo (Exchange 2016) in the main OWA window and then Change:
 
2.    Using the options menu and then account followed by Edit information... in Exchange 2013, or “My account” section:
 

 

 
Some companies do not like the idea of users updating their pictures themselves. There are already many posts out there on how to prevent users from changing their photo in OWA. However, some posts only say to change the SetPhotoEnabled parameter to False for all OWA virtual directories:
Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -SetPhotoEnabled $False
 
If we now click on our display name or photo, the Change button is now gone:

 

The problem is that this method might only prevents users from clicking their photo to change their photo! It is possible that users can still change it through the options menu:


The reason why this might happen is because this setting only applies to mailboxes if they do not have an OWA Mailbox Policy applied to them! If they do, then we also need to update this policy, whether it is the Default policy or not. In this case I am updating all policies and applying the default one just to my account for testing:
Get-OWAMailboxPolicy | Set-OWAMailboxPolicy -SetPhotoEnabled $False
Set-CASMailbox nuno -OWAMailboxPolicy Default

Now the change button is finally gone:


Wednesday, December 2, 2015

Exchange Web Services Editor

Using PowerShell, Exchange administrators can develop scripts to do almost everything. However, there are occasions where a script that uses Exchange Web Services (EWS) is required, may that be for an administrative task or to develop an entire application.
 
I have developed a few EWS scripts but I admit I am no expert on the subject. As such, sometimes I rely on a great tool that not many people are aware of, the EWS Editor. This tool has 3 main goals:
1.      "Demonstrate the Exchange Web Services Managed API functionality and simplicity to developers through its source code;
2.      Demonstrate the Exchange Web Services SOAP traffic used to perform actions initiated through an explorer user interface;
3.      Assist non-developers in debugging and understanding Exchange stores by exploring items, folders, and their properties in depth."
 
Each release of EWS Editor includes the distribution of the EWS Managed API it was built for. EWSEditor uses .NET Framework version 4.5 which can be downloaded here: .NET Framework 4.5. The latest version of EWS Editor (from May 2015) uses .EWS Managed API 2.2, which requires a minimal of .NET 3.5. EWS Editor can be downloaded from CodePlex.
 
EWS Editor is, in some ways, similar to MFCMapi, another great tool. It does not require installation and unlike MFCMapi it does not require Outlook profiles in order to access mailbox items as it does everything over EWS.
We can check mailbox items and their properties:



We can look into particular folders, its emails, attachments, properties (notice how all the property names are easy to read), etc.:


 
We can test and get information regarding AutoDiscover:


The tool comes with a multitude of EWS Posts examples that we can use to see how they are built or even post them against Exchange and analyze the response:


 
We can also check and/or set Out-Of-Office messages for users (assuming we have the right permissions to do so):


It even comes with a handy Distribution Group expansion tool that allows us to see exactly who is a member of a particular group:
Another great tool is the Debug Log Viewer where we can see all the EWS requests and responses for all the actions we do using this tool (in this case we can see the response from the Messaging group expansion above):


There are many, many other things we can use this tool for: