Wednesday , October 16 2019

Connecting to PowerShell Online

  • Exchange Online PowerShell (Exchange Settings)
  • Azure Active Directory MSOnline (msol cmdlets)
  • Azure Active Directory PowerShell for Graph (azuread cmdlets)
  • Virtual Machine settings using Powershell (AzureRM cndlets)

PowerShell Capabilities are limitless with these modules you can automate most of the repetitive activities with ease.

Exchange Online PowerShell

Exchange Online PowerShell allows you to Exchange Online settings using a command line. You can manage all bulk changes using scripts and with a variety of commands using pipeline methods.

image

Lets see how to Connect Exchange Online PowerShell

Set-ExecutionPolicy RemoteSigned

image

$UserCredential = Get-Credential

image

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

image

Sample Command to make sure its connected.

image

You can explore the commands available using

get-command

it support wildcards

image

Connecting to Office 365 PowerShell

Mostly to manage azure active directory users

Microsoft Azure Active Directory Module for Windows PowerShell (cmdlets include MSol in their name)

Install-Module MSOnline

image

Connect-MsolService

image

Sample Command to make sure its connected.

Get-MsolUser -UserPrincipalName user@domain.com

image

Azure Active Directory PowerShell for Graph (cmdlets include AzureAD in their name)

Install-Module -Name AzureAD

image

image

Connect-AzureAD

image

Get-AzureADDomain -Name azure365pro.com

image

To Get Virtual Machine settings using Powershell and AzureRM commandlets

Install-Module AzureRM

image

Connect-AzurermAccount

image

Sample Command to make sure its connected.

Get-AzureRmVM

image

Please note that if you don’t kill your session. You may need to wait until the power shell session expires if you reconnect multiple times.

Remove-PSSession $Session

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Save Public IPs using F5 LTM Policies

F5 has different modules and one of them is LTM – Local Traffic Manager . ...

Leave a Reply

Your email address will not be published.