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

Comments

Popular posts from this blog

SharePoint - Field type [FieldName] is not installed properly. Go to the list settings page to delete this field.

Office 365 Groups - Quickly find the GUID of a O365 Group

Export Group Membership From Active Directory Using Power Query