使用powershell連接Office 365

先決條件

?安裝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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章