Connect to Exchange Online using remote PowerShell (e.g. Turn Off Clutter)

To enable Windows PowerShell to run signed scripts, run the following command in an elevated Windows PowerShell window (a Windows PowerShell window you open by selecting Run as administrator):

Set-ExecutionPolicy RemoteSigned

(You need to configure this setting only once on your computer, not every time you connect.)

1. On your local computer, open Windows PowerShell and run the following command:

$UserCredential = Get-Credential

In the Windows PowerShell Credential Request dialog box, type your Office 365 user name and password, and then click OK.

2. Run the following command:

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

3. Run the following command:

Import-PSSession $Session

4. Perform any PowerShell commands as needed. For example, to disable Clutter on all mailboxes, run the following command:

get-mailbox |set-clutter -enable $false

5. NOTE: Be sure to disconnect the remote PowerShell session when you’re finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you’ll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command:

Remove-PSSession $Session

6. Exit PowerShell by typing “Exit”.