Page 1 of 1

MS 365: how to connect to MSOnline

Posted: 24 Feb 2023, 13:28
by daniele
NOTA BENE
I modules Powershell sono ubicati nei seguenti path:
C:\Program Files\WindowsPowerShell\Modules --> quando si usa come Administrator
C:\Users\username\Documents\PowerShell\Modules --> per ogni singolo utente

Se ricevete errore tentando di eseguire Connect-MsolService, provare a cancellare la cartella che contiene il modulo \MSOnline e poi ritentare daccapo

Aprire PowerShell come ADMINISTRATOR
Powershell has to be v. 7 or later

Modalità PowerShell

Code: Select all

# Install the MSOnline module if this is first use
Install-Module MSOnline
# Add the MSOnline module to the PowerShell session
Import-Module MSOnline -UseWindowsPowershell
NOTE: the parameter -UseWindowsPowershell is needed, currently, otherwise you'll have an error while trying to connect
# Connect to MSOnline Service
Connect-MsolService


Modalità "nativa" (non è chiaro in quale contesto possa funzionare..)

Code: Select all

# Install the MSOnline module if this is first use
Install-Module MSOnline
# Add the MSOnline module to the PowerShell session
Import-Module MSOnline
# Get credentials of Azure admin
$Credentials = Get-Credential
# Connect to Azure AD
Connect-MsolService -Credential $Credentials



References:
https://www.easy365manager.com/knowledg ... ecognized/