powershell批量獲取office365用戶郵箱使用容量

公司用的office365的Excahnge Online,云端默認(rèn)有50G容量。

目前創(chuàng)新互聯(lián)建站已為1000多家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)絡(luò)空間、網(wǎng)站托管、企業(yè)網(wǎng)站設(shè)計、寧海網(wǎng)站維護(hù)等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

2,3年下來,發(fā)現(xiàn)銷售或者售后的郵箱容量會很快就要到達(dá)極限了,為了方便查看那些用戶快到使用極限,那肯定要用powershell.

附:官方文檔,如何用powershell連接到Exchange Online
https://docs.microsoft.com/zh-cn/powershell/exchange/exchange-eop/connect-to-exchange-online-protection-powershell?view=exchange-ps

#獲取ECH用戶郵箱到csv,再AD內(nèi)執(zhí)行
Get-ADUser -SearchBase 'OU=users,DC=domain,DC=com' -Filter {(mail -ne "null") -and (Enabled -eq "true")} -Properties mail | Select-Object mail | export-csv -Path C:\Script\maillist.csv -NoTypeInformation

#office365管理員賬號
$pw=ConvertTo-SecureString -String "Password" -AsPlainText -force
$cre= New-Object System.Management.Automation.PSCredential("xx@domain.com",$pw)
#鏈接office365
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cre -Authentication Basic -AllowRedirection
#創(chuàng)建會話
Import-PSSession $Session -DisableNameChecking

#導(dǎo)入email地址 并輸出其郵件容量
Import-Csv C:\Script\maillist.csv| %{
$id=$_.mail
$size=Get-MailboxStatistics $id | select TotalItemSize

[pscustomobject]@{

email=$id
Size=$size
}

}|Export-Csv -Path C:\Script\size.csv -NoTypeInformation

#斷開會話
Remove-PSSession $Session

名稱欄目:powershell批量獲取office365用戶郵箱使用容量
標(biāo)題網(wǎng)址:http://bm7419.com/article4/jdggie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、品牌網(wǎng)站制作、品牌網(wǎng)站設(shè)計網(wǎng)站策劃、品牌網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)