This one is more a reminder for my self, but may come in handy for you too đŸ™‚

When you want to manage O365 subscription with Powershell you first need to login to it:


This command will open a new window for you to sign in to your subscription:

After logging, you may execute the next command just to confirm that it was successful:


If you run next command you will get all currently available commands:

get-command *msol*

As you will see from the list, for example, Exchange OnLine commands are not available. For you to access those, you need to authenticate to that service particularly.

$UserCredential = Get-Credential #Put your credential in variable to use later

$ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $ExchangeSession -DisableNameChecking

You will get something similar to this:

Now you will be available to use commands like “Get-Mailbox” and others.

When you finish with your work, don’t forget to close your session:

Remove-PSSession $ExchangeSession

Connecting to Skype for Business Online:

Import-Module SkypeOnlineConnector

$sfboSession = New-CsOnlineSession -Credential $UserCredential

Import-PSSession $sfboSession

Connecting to SharePoint Online:

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

#Now you have imported the PowerShell module, next step is to determine the SharePoint Online admin site URL so that you can connect to it.


#If Fully Qualified Domain Name (FQDN) is, the hostname is tech-trainer.

#When you have determined the site URL, execute the following command to connect to SharePoint Online. 

Connect-SPOService -Url -credential $UserCredential

#To verify the connection, execute the following command.



Have another great day in Admins life đŸ™‚

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.