mirror of
https://github.com/admindroid-community/powershell-scripts.git
synced 2025-12-17 16:35:19 +00:00
Install and Connect to EXO
Install and Connect to EXO
This commit is contained in:
parent
f8913aec89
commit
746b632235
31
Install and Connect to EXO/InstallAndConnectEXO.ps1
Normal file
31
Install and Connect to EXO/InstallAndConnectEXO.ps1
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<#
|
||||||
|
=============================================================================================
|
||||||
|
Name: Install EXO V3 module and connects to Exchange Online PowerShell
|
||||||
|
Version: 3.0
|
||||||
|
Website: M365scripts.com
|
||||||
|
For detailed Script execution: https://m365scripts.com/exchange-online/connect-to-exchange-online-powershell/
|
||||||
|
============================================================================================
|
||||||
|
#>
|
||||||
|
|
||||||
|
|
||||||
|
#Due RPS and Basic Auth retirement in Exchange Online, we need EXO V3 module
|
||||||
|
$Module = (Get-Module ExchangeOnlineManagement -ListAvailable) | where {$_.Version.major -ge 3}
|
||||||
|
if($Module.count -eq 0)
|
||||||
|
{
|
||||||
|
Write-Host Exchange Online PowerShell V3 module is not available -ForegroundColor yellow
|
||||||
|
$Confirm= Read-Host Are you sure you want to install module? [Y] Yes [N] No
|
||||||
|
if($Confirm -match "[yY]")
|
||||||
|
{
|
||||||
|
Write-host "Installing Exchange Online PowerShell module"
|
||||||
|
Install-Module ExchangeOnlineManagement -Repository PSGallery -AllowClobber -Force
|
||||||
|
Import-Module ExchangeOnlineManagement
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host EXO V3 module is required to connect Exchange Online. Please install module using Install-Module ExchangeOnlineManagement cmdlet.
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host Connecting to Exchange Online...
|
||||||
|
Connect-ExchangeOnline
|
||||||
Loading…
x
Reference in New Issue
Block a user