$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
set-executionpolicy remotesigned
Import-PSSession $Session
Get-Mailbox
Get-Mailbox | Set-MailboxJunkEmailConfiguration –Enabled $False