daknetworks.com

You are here: Blog Powershell Connect To AzureAD | Connect to Office365

Powershell Connect To AzureAD | Connect to Office365

This information is in other articles that are posted but they can be overly complicated. This is the TLDR version.

Start Powershell

  • -start POWERSHELL (as administrator).
  • -type: $LiveCred = Get-Credential
  • -type in your username/password.

Office365 Endpoints | O365 Endpoints | Azure Endpoints | Microsoft Online Endpoints

From here you have the option to connect to different ENDPOINTS of Office365/AzureAD. The information is the same but data is displayed differently depending on which endpoint is being used.

The ENDPOINTS I use regularly are:

  1. OUTLOOK/Exchange-Online
  2. AzureAD
  3. MSOnline

Install Module

To connect to the endpoints, a module must be installed into Powershell. So if this is the first time, depending on the endpoint,use the following

  1. Outlook/Exchange-Online: does not need a moduel
  2. AzureAD: type: Install-Module AzureAD
  3. MSOline: type: Install-Module MSOline

Note that this only has to be done once. After the module is installed into Powershell, it remains.

Connect to Endpoint

After the module is installed into Powershell, the connection is as follows:

  1. OUTLOOK/Exchange-Online: type:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
    Import-PSSession $Session -AllowClobber
  2. AzureAD: Connect-azuread -Credential $LiveCred
  3. MSOnline: Connect-MsolService -Credential $LiveCred

Which Endpoint Is Best

It depends on what you are trying to do.

  1. OUTLOOK/Exchange-Online: for the Exchange portion of Office365. Should be easy to determine if it is needed.
  2. AzureAD: new endpoint that seems to have development in the works. To me the commands are long and arduous.
  3. MSOnline: tried and true as a legacy option that seems to work.

Contact Dak Networks

Please contact us at the following.