最後更新: 2019-05-10
User 's Mailbox Info.
# Mailbox Info
Get-Mailbox USERNAME
Name Alias ServerName ProhibitSendQuota ---- ----- ---------- ----------------- username username exserver unlimited
# More Info
Get-Mailbox USERNAME | fl
# Client Access settings
Get-CASMailbox tim | fl
Mailbox List
# All mailbox
Get-Mailbox | Select-Object PrimarySmtpAddress | Sort PrimarySmtpAddress
# Active mailbox
Get-Mailbox | where {$_.OrganizationalUnit -like "*remove_user*"} | Select-Object PrimarySmtpAddress | Sort PrimarySmtpAddres
LastLogonTime
Get-MailboxStatistics -Identity tester
DisplayName ItemCount StorageLimitStatus LastLogonTime ----------- --------- ------------------ ------------- tester 38 9/2/2016 1:31:05 PM
Mailbox size
An user usage
Get-MailboxStatistics -Identity tim.lau | fl DisplayName, TotalItemSize, ItemCount
DisplayName : tim lau TotalItemSize : 2.124 MB (2,227,148 bytes) ItemCount : 21
All user usage
Get-Mailbox | Get-MailboxStatistics | fl DisplayName, TotalItemSize, ItemCount
Disable a mailbox
If you disable a mailbox, then all Exchange specific attributes are removed from the according Active Directory user.
The Exchange data will not be deleted at this time, but you will find the mailbox in the disconnected mailbox section of the recipient administration.
And you are able to connect this mailbox to another Active Directory user.
You have to configure the retention time of the mailboxdatabase in orderr to configure the time this unconnected mailbox is stored on your Exchangeserver.
When we disable a mailbox in Exchange Server 2007 we are removing the exchange attributes of this mailbox, but the user remains in Active Directory.
個 Disable mailbox 會 Default 在 30 被 exchange 刪除
CLI
Disable-Mailbox -id "alias"
設定 Iteam 可以保留幾多日
Set-Mailbox -Identity "alias" -RetainDeletedItemsFor 30
Removing mailboxes
We can also remove a mailbox, but be aware that removing a mailbox will also delete the object in Active Directory.
Remove-Mailbox -Identity "alias"
Reconnecting Mailboxes
By default all the removed/disabled mailboxes stay in the mailbox store for 30 (thirty) days.
This value can be set at mailbox store level.
To change this retention value we should:
Open Exchange Management Console
Expand Server Configuration
Click on Mailbox
Select your server in the Mailbox Pane
Click on Mailbox Store in the Result Pane
Click on Properties in the Actions pane (Figure 11)
Login 時的 Event Log
4776
The computer attempted to validate the credentials for an account. Authentication Package: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0 Logon Account: tim Source Workstation: EXSERVER Error Code: 0x0
4648
A logon was attempted using explicit credentials. ... Account Whose Credentials Were Used: Account Name: tim Account Domain: MYMAILSERVER Logon GUID: {00000000-0000-0000-0000-000000000000} ... Process Information: Process ID: 0x15a0 Process Name: C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\PopImap\Microsoft.Exchange.Imap4.exe Network Information: Network Address: - Port: -
4624
An account was successfully logged on. ... Process Information: Process ID: 0x15a0 Process Name: C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\PopImap\Microsoft.Exchange.Imap4.exe Network Information: Workstation Name: EXSERVER Source Network Address: - Source Port: - ...
Exchange check forwarding
[1]
Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name, ForwardingAddress, DeliverToMailboxAndForward
[2]
Get-Mailbox -Filter {ForwardingAddress -ne $null} | ft Name,ForwardingAddress,DeliverToMailboxAndForward -Autosize
Exchange 2010 mail contacts
Mail contacts are an Exchange recipient type.
They are essentially the same thing as Active Directory contacts,
but with one exception -- they are mail-enabled.
Mail contacts are created through the Exchange Management Console (EMC) / New-MailContact command
Both mail users and mail contacts appear in the Global Address List (GAL)
Active Directory contacts
Contacts are Active Directory objects that are totally independent of Exchange Server.
("Active Directory Users and Computers" console)
An Active Directory contact is really just a repository for information.
mail users
The only thing that differentiates a mail user from any other user in an Exchange organization
is that mail users cannot send and receive Exchange mail.
The user's account is a link to an external email address. (people outside your Exchange )
Microsoft refers to Active Directory users with Exchange mailboxes as Mail Enabled Users;
do not confuse this with mail users. These mailboxes are also sometimes referred to as user mailboxes.
mail users have an Active Directory account and require a client access license (CAL).
其他 CMD
Get-Recipient
The Select command is very powerful to find out more about it run the command:
Get-Help Select -Full
Get-Recipient | Select EmailAddresses
# 看清楚原整的 EmailAddresses
# Default 的 list 會有 "xxx..."
Get-Recipient | Select Name -ExpandProperty EmailAddresses
Get-Recipient | Select Name -ExpandProperty EmailAddresses | Select SmtpAddress
Remark
GM is an alias of Get-Member