How to connect to tenant Powershell

On the computer that hosts the data warehouse management server, click Start, point to Programs, point to Windows PowerShell 1.0, right-click Windows PowerShell, and then click Run as administrator .

At the Windows PowerShell prompt, type the following command, and then press ENTER:

Test-path $profile

If the results of the previous command are false, type the following command, and then press ENTER.

New-item –type file –force $profile

Create a profile in PowerShell.

Open PowerShell as an administrator then type:

notepad $profile

Add the following to the notepad instance and save

Function Connect-EXOnline{
$credentials = Get-Credential
$CustomerDomain = Read-Host -Prompt 'Enter the customers primary 365 domain'
Write-Output "Getting the Exchange Online cmdlets"
$Session = New-PSSession -ConnectionUri https://outlook.office365.com/powershell-liveid?DelegatedOrg=$CustomerDomain `
-ConfigurationName Microsoft.Exchange -Credential $credentials `
-Authentication Basic -AllowRedirection
Import-PSSession $Session
}

Connect to ExOnline using:

Connect-EXOnline
  • Last modified: 2018/05/27 19:20
  • by coriron