Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Powershell batch acquires mailbox usage capacity of office365 users

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The company uses office365's Excahnge Online, which has a default capacity of 50 gigabytes in the cloud.

2Jing 3 years later, found that the sales or after-sales mailbox capacity will soon reach the limit, in order to facilitate the check of those users who are fast to the limit, it is necessary to use powershell.

Attached: official documentation, how to connect to Exchange Online using powershell

Https://docs.microsoft.com/zh-cn/powershell/exchange/exchange-eop/connect-to-exchange-online-protection-powershell?view=exchange-ps

# get ECH user mailbox to csv Then execute 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 administrator account $pw=ConvertTo-SecureString-String "Password"-AsPlainText-force$cre= New-Object System.Management.Automation.PSCredential ("xx@domain.com") $pw) # Link office365 $Session = New-PSSession-ConfigurationName Microsoft.Exchange-ConnectionUri https://outlook.office365.com/powershell-liveid/-Credential $cre-Authentication Basic-AllowRedirection# create session Import-PSSession $Session-DisableNameChecking# Import email address and output its email capacity Import-Csv C:\ Script\ maillist.csv |% {id=$_.mail$size=Get-MailboxStatistics $id | select TotalItemSize [pscustomobject] @ {email=$idSize=$size} | Export-Csv-Path C:\ Script\ size.csv-NoTypeInformation# disconnect session Remove-PSSession $Session

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report