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:
- OUTLOOK/Exchange-Online
- AzureAD
- MSOnline
- Skype-for-Business/Teams
- Microsoft Teams
Note that all modules can be found here (although look closely as the names can be unnatural to some):
https://docs.microsoft.com/en-us/powershell/module/
See Installed Modules
If you want to see the installed modules, you can view by:
Get-InstalledModule
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
- Outlook/Exchange-Online: type: Install-Module ExchangeOnlineManagement
- AzureAD: type: Install-Module AzureAD (or Install-Module AzureADPreview)
- MSOline: type: Install-Module MSOnline
- Skype-for-Business/Teams: Import-Module SkypeOnlineConnector
- Teams: Install-Module MicrosoftTeams
Note that this only has to be done once. After the module is installed into Powershell, it remains.
Also note that since the AzureAd module is being actively developed, the "preview" module, or beta-version, has additional commands that the current release does not. However only one of the AzureAD modules (either AzureAD or AzureADPreview) can be installed at a time.
Connect to Endpoint
After the module is installed into Powershell, the connection is as follows:
- OUTLOOK/Exchange-Online: type:
Connect-ExchangeOnline -UserPrincipalName This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Connect-ExchangeOnline -UserPrincipalName This e-mail address is being protected from spambots. You need JavaScript enabled to view it -DelegatedOrganization adatum.onmicrosoft.com
Old-way: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session -AllowClobber - AzureAD: Connect-azuread -Credential $LiveCred
Import-PSSession $Session -AllowClobber - MSOnline: Connect-MsolService -Credential $LiveCred
- Skype-for-Business/Teams: type:
$sfbSession = New-CsOnlineSession -Credential $LiveCred
Import-PSSession $sfbSession - Teams: Connect-microsoftteams -Credential $LiveCred
Import-PSSession $Session -AllowClobber
Which Endpoint Is Best
It depends on what you are trying to do.
- OUTLOOK/Exchange-Online: for the Exchange portion of Office365. Should be easy to determine if it is needed.
- AzureAD: new endpoint that seems to have development in the works. To me the commands are long and arduous but it has the advantage of automation or workflow.
- MSOnline: tried and true as a legacy option that seems to work best.
- Skype-for-Business/Teams: for the Skype-for-Business/Teams portion of Office365.
- Teams: for the Microsoft Teams portion of Office365.
Uninstall Module
Here is how to uninstall a module:
Uninstall-Module ModuleNameHere
(ie: Uninstall-Module AzureAD)