Sunday, 28 June 2015

Connect to Exchange Online via Powershell & Allow File Types

##RUN POWERSHELL AS ADMINISTRATOR
##Use this when you need to make configuration changes to your Exchange environment that can't be done via the GUI

##Connect to Exchange Online via Powershell

Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session


##How to Allow File Types to be opened in Exchange Online

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Select -ExpandProperty BlockedFileTypes | Sort
Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy -BlockedFileTypes @{Remove = ".xml"}
Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy -AllowedFileTypes @{Add = ".xml"}
Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy -BlockedMimeTypes @{Remove = "text/xml", "application/xml”}
Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy –AllowedMimeTypes @{Add = "text/xml", "application/xml”}


##How to Disconnect from Session (important to do when you are finished)

Remove-PSSession $Session

No comments:

Post a Comment