先决条件

?安装Azure AD模块的系统要求:Windows 8.1、Windows 8、Windows 7

?软件要求及下载链接

a. Microsoft Online Services 登录助手,下载链接如下:

http://www.microsoft.com/zh-cn/download/details.aspx?id=41950

b. Microsoft Azure Active Directory 模块,下载链接如下:

http://go.microsoft.com/fwlink/p/?linkid=236297

(1)运行程序Microsoft Online Services 登录助手(msoidcli_64),点击“安装”

clip_p_w_picpath002

(2)运行Microsoft Azure Active Directory 模块程序,点击“Next”

clip_p_w_picpath003

(3)以管理员身份运行powershell

注:此poershell并非windows powershell,而是用户windows powershell 的windows azure active directory模块,如图

clip_p_w_picpath004

鼠标“右键”点击以管理员身份运行

clip_p_w_picpath005

连接到Office365管理中心

 Import-Module MSOnline

Connect-MsolService


连接到Exchange online执行如下命令

连接到世纪互联的Office 365

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell-LiveID/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session


连接到全球版Office 365

$UserCredential = Get-Credential

$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection

Import-PSSession $exchangeSession