From b4208dbb4f689e638227bc6b7cbe53866518e214 Mon Sep 17 00:00:00 2001 From: "Tom Wechsler [Microsoft Azure & CDM MVP]" <56835948+tomwechsler@users.noreply.github.com> Date: Mon, 17 Oct 2022 11:30:30 +0200 Subject: [PATCH] Add files via upload --- Connect_Microsoft_Cloud.ps1 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Connect_Microsoft_Cloud.ps1 diff --git a/Connect_Microsoft_Cloud.ps1 b/Connect_Microsoft_Cloud.ps1 new file mode 100644 index 0000000..cc00947 --- /dev/null +++ b/Connect_Microsoft_Cloud.ps1 @@ -0,0 +1,29 @@ +Set-Location C:\ +Clear-Host + +#We need the module (without the parameter for a specific version) +Install-Module -Name ExchangeOnlineManagement -AllowClobber -Force -Verbose + +#More specific if you want +Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.0.0 -AllowClobber -Force -Verbose + +#Let's import the module +Import-Module ExchangeOnlineManagement + +#Check the version (if you have not selected a version) +Get-InstalledModule -Name ExchangeOnlineManagement + +#Now we connect to Exchange Online +Connect-ExchangeOnline + +#Install the Azure AD Module +Install-Module -Name AzureAD -AllowClobber -Force -Verbose + +#Let's import the module +Import-Module AzureAD + +#Now we connect to Azure Active Directory +Connect-AzureAD + +Disconnect-AzureAD +Disconnect-ExchangeOnline \ No newline at end of file