1.允许运行安装不信任的脚本
Set-ExecutionPolicy RemoteSigned
Install-Module PowershellGet -Force
2.安装连接模块:
Install-Module MSOnline
Install-Module -Name MSOnline
3.安装Excahnge管理模块:
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.3.0
4.连接到Office365 Exchange
Connect-ExchangeOnline -UserPrincipalName admin@wjbqq.com