PowerShell Management Series (30) PowerShell Operations statistics mailbox User Information

Source: Internet
Author: User

-----provide ad\exchange\lync\sharepoint\crm\sc\o365 and other Microsoft product implementation and outsourcing, qq:185426445. Phone 18666943750

Users need to count the specific information of the mailbox users, such as login name, email address, company name, department, etc., this information can be through the command of the non-access to, how we use the script to summarize this information together, the command is as follows:

Step 1, enter the following command on the PowerShell command line

Add-pssnapin microsoft.exchange*
$user =get-user-resultsize unlimited-recipienttypedetails Usermailbox
[Email protected] ()
foreach ($i in $user)
{
$mbxstatistics =get-mailbox $i. identity| Get-mailboxstatistics
$mbxsarctatistics =get-mailbox $i. identity-archive| Get-mailboxstatistics-archive
$mbxtotal =get-mailbox $i. identity| Select-object @{n= "display name"; E={$_.displayname}}, '
@{n= "login name"; E={$_.samaccountname}}, '
@{n= "e-mail Address"; e={$_. PrimarySmtpAddress}}, '
@{n= "Company name"; e={$i. Companies}}, '
@{n= "department"; e={$i. Department}}, '
@{n= "Number of mailboxes"; e={$mbxstatistics. ItemCount}}, '
@{n= "Mailbox Size (MB)"; e={$mbxstatistics. TotalItemSize.value.tomb ()}}, '
@{n= "Number of archive mailboxes"; e={$mbxsarctatistics. ItemCount}}, '
@{n= "Archive mailbox Size (MB)"; e={$mbxsarctatistics. TotalItemSize.value.tomb ()}}, '
@{n= "Mounted server name"; e={$mbxstatistics. ServerName}}, '
@{n= "Last logon Time"; e={$mbxstatistics. Lastlogontime}}, '
@{n= "database name"; e={$mbxstatistics. DatabaseName}}
$userinfo + = $mbxtotal
}
$userinfo
$userinfo | Export-csv-path c:\mbxinfo.csv-NoTypeInformation-Encoding UTF8

650) this.width=650; "Width=" 760 "height=" 422 "title=" QQ picture 20160311002349.png "style=" WIDTH:713PX;HEIGHT:394PX; "alt= "Wkiol1bhoc3jfphtaaeu6uhzh5y607.png" src= "Http://s3.51cto.com/wyfs02/M02/7D/2F/wKioL1bhoC3jfPhTAAEu6UHZh5Y607.png"/>

Step 2, export the information as follows, so far, we need the information has been all query and export to the CSV table

650) this.width=650; "Width=" 1152 "height=" 617 "title=" QQ picture 20160311002349.png "style=" WIDTH:714PX;HEIGHT:482PX; "alt = "Wkiom1bholpszgijaajf5jejzlo318.png" src= "Http://s1.51cto.com/wyfs02/M00/7D/31/wKiom1bhoLPSzgIJAAJF5JEJzlo318.png"/>

This article is from the "Zhou Ping Microsoft Technology Exchange Platform" blog, please be sure to keep this source http://yuntcloud.blog.51cto.com/1173839/1749788

PowerShell Management Series (30) PowerShell Operations statistics mailbox User Information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.