Jul.03

Enable XML attachments on Exchange Online

Enable XML attachments on Exchange Online
    1. Right click on the PowerShell Console icon and chose the option: Run as administrator.
    2. To change the Execution policy open the Microsoft Online Services Module for Windows PowerShell and type the command:
      Set-ExecutionPolicy unrestricted
    3. For creating the remote connection we will need to use  a set of three PowerShell commands. Each command perform different task and include variable that serve as a “container” for information such as: user credentials, URL etc. Execute the following command: 
      $cred = Get-Credential
      $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic –AllowRedirection
      Import-PSSession $Session
    4. A pop out windows will appear. Type your credentials by using the UPN (user Principal name) format. User should have global administrator rights in the office 365 environment. To view all the allowed file type, you can use this command:
      (get-OwaMailboxPolicy OwaMailboxPolicy-Default).AllowedFileTypes
    5. To allow a specific file type (such as .xml file), use this command: 
      Set-OwaMailboxPolicy OwaMailboxPolicy-Default -AllowedFileTypes  @{add= '.xml'} Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -BlockedFileTypes @{Remove = ".xml"}
      Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -AllowedFileTypes @{Add = ".xml"}
      Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -BlockedMimeTypes @{Remove = "text/xml", "application/xml”}
      Get-OwaMailboxPolicy | Set-OwaMailboxPolicy –AllowedMimeTypes @{Add = "text/xml", "application/xml”}
    6. Disconnect the remote connection with the following command:
      Remove-PSSession $Session
Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment