Get-Mailbox

 

適用版本: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1

上次修改主題的時間: 2010-04-27

使用 Get-Mailbox 指令程式,可以檢視信箱物件及屬性、填入內容頁,或將信箱資訊提供給其他工作。

語法

get-Mailbox [-Identity <MailboxIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

get-Mailbox [-Credential <PSCredential>] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-Server <ServerIdParameter>] [-SortBy <String>]

get-Mailbox [-Credential <PSCredential>] [-Database <DatabaseIdParameter>] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

get-Mailbox [-Credential <PSCredential>] [-DomainController <Fqdn>] [-Filter <String>] [-IgnoreDefaultScope <SwitchParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

get-Mailbox [-Anr <String>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

詳細描述

Get-Mailbox 指令程式會擷取信箱的屬性及物件。不需要參數。如果使用指令程式不加參數,則會列出組織中所有的信箱。

若要執行 Get-Mailbox 指令程式,您使用的帳戶必須已委派下列資格:

  • Exchange 僅檢視管理角色

如需管理 Microsoft Exchange Server 2007 所需之權限、委派角色及權利的相關資訊,請參閱權限考量

note附註:
若要使用 Get-Mailbox 指令程式精確評估目前的儲存配額狀態,則除了 ProhibitSendQuota、ProhibitSendReceiveQuota 及 IssueWarningQuota 內容外,還需要查看 UseDatabaseQuotaDefaults 內容。UseDatabaseQuotaDefaults 內容的值為 True,表示會忽略每個信箱設定,並使用信箱資料庫限制。如果此內容設為 True,而 ProhibitSendQuota、ProhibitSendReceiveQuota 及 IssueWarningQuota 內容設為 unlimited,則信箱不會有無限的大小。此時您必須參考信箱資料庫儲存限制,以了解信箱容量限制。UseDatabaseQuotaDefaults 內容的值為 False,表示會使用每個信箱設定。

參數

參數 必要 類型 描述

Anr

選用

System.String

Anr 參數指定要執行不明確名稱解析搜尋的字串。您可以指定部分字串,並搜尋具有與該字串相符之屬性的物件。所搜尋的預設屬性如下:

  • CommonName (CN)

  • DisplayName

  • FirstName

  • LastName

  • Alias

Credential

選用

System.Management.Automation.PSCredential

Credential 參數可指定用以存取 Active Directory 目錄服務的使用者名稱及密碼。

Database

選用

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

Database 參數指定所要取得信箱的來源資料庫。您可以使用下列值:

  • 資料庫的 GUID

  • 資料庫名稱

  • 伺服器名稱\資料庫名稱

  • 伺服器名稱\儲存群組\資料庫名稱

若不指定伺服器名稱,則指令程式會搜尋本機伺服器上的資料庫。如果在相同伺服器上有多個名稱相同的資料庫,則必須指定儲存群組。

這個參數無法和 Filter 參數一起使用。

DomainController

選用

Microsoft.Exchange.Data.Fqdn

DomainController 參數可指定用於存取 Active Directory 的網域控制站。請使用想要使用之網域控制站的網域全名 (FQDN)。

Filter

選用

System.String

Filter 參數可指定用來限制查詢所傳回之信箱的一或多個屬性。

這個參數無法和 Database 參數一起使用。

如需可過濾內容的詳細資訊,請參閱-Filter 參數的可篩選內容

Identity

選用

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

Identity 參數會識別信箱。您可以使用下列其中一個值:

  • GUID

  • 辨別名稱 (DN)

  • 網域\帳戶

  • 使用者主要名稱 (UPN)

  • LegacyExchangeDN

  • SmtpAddress

  • 別名

IgnoreDefaultScope

選用

System.Management.Automation.SwitchParameter

IgnoreDefaultScope 參數會指示命令略過 Exchange 管理命令介面的預設收件者範圍設定,並以整個樹系作為範圍。如此可讓命令存取目前不在預設範圍內的 Active Directory 物件。使用 IgnoreDefaultScope 參數會產生下列限制:

  • 您無法使用 DomainController 參數。此命令會自動使用適當的通用類別目錄伺服器。

  • 您只可以針對 Identity 參數使用 DN。不接受其他形式的識別碼 (如別名或 GUID)。

  • 您無法同時使用 OrganizationalUnitIdentity 參數。

  • 您無法使用 Credential 參數。

OrganizationalUnit

選用

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

OrganizationalUnit 參數指定組織單位 (OU),並用來限制結果。如果使用此參數,則只會得到您所指定容器中的信箱。您可以使用 OU 或網域名稱。如果使用 OU,則必須指定 OU 的標準名稱。

ReadFromDomainController

選用

System.Management.Automation.SwitchParameter

ReadFromDomainController 參數指定從使用者網域的網域控制站讀取使用者資訊。如果您將收件者範圍設定為包含所有樹系中的收件者,且如果您不使用此參數,則可能會從通用類別目錄讀取含有過時資訊的使用者資訊。如果使用此參數,則可能需要多次讀取才能取得資訊。

note附註:
依預設,收件者範圍會設為主控您的 Exchange 伺服器之網域。

RecipientTypeDetails

選用

Microsoft.Exchange.Data.Directory.Recipient.RecipientTypeDetails[]

RecipientTypeDetails 參數指定傳回的收件者類型。Microsoft Exchange Server 2007 中的收件者類型可分為收件者類型與子類型。每位收件者類型包含所有子類型的所有一般內容。例如,類型 UserMailbox 代表 Active Directory 中,具有關聯信箱的使用者帳戶。因為有數個信箱類型,每個信箱類型是透過 RecipientTypeDetails 參數來加以識別。例如,會議室信箱的 RecipientTypeDetails 是設定為 RoomMailbox,而使用者信箱的 RecipientTypeDetails 則是設定為 UserMailbox。

對於此命令,可用的收件者類型詳細資料為:

  • RoomMailbox

  • EquipmentMailbox

  • LegacyMailbox

  • LinkedMailbox

  • UserMailbox

  • SharedMailbox

ResultSize

選用

Microsoft.Exchange.Data.Unlimited

ResultSize 參數可指定傳回的結果筆數上限。若要傳回符合查詢的所有信箱,請使用 [無限制] 作為此參數的值。預設值為 1000。

Server

選用

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

Server 參數指定個別伺服器,並用來限制結果。如果使用此參數,則只會得到位於您所指定伺服器上的信箱。請使用所要指定伺服器的一般名稱。

SortBy

選用

System.String

SortBy 參數指定用來排序結果的屬性。您一次只可以依據一個屬性進行排序。您可以依據下列屬性進行排序:

  • 別名

  • 顯示名稱

  • 名稱

結果會以遞增順序進行排序。

輸入類型

傳回類型

錯誤

錯誤 描述

 

例外狀況

例外狀況 描述

 

範例

第一個範例顯示如何取得組織中所有信箱的清單。

第二個範例顯示如何取得組織中 Contoso.com 網域的 Users 容器內所有信箱的清單。

第三個範例顯示如何使用不明確名稱解析搜尋,取得 DC01 網域中名稱含有 "Chr" 字串的所有信箱。這會傳回 Chris Ashton、Christian Cletus 及 Christa Geller 等使用者的信箱。

Get-Mailbox -ResultSize unlimited
Get-Mailbox -OrganizationalUnit Users
Get-Mailbox -Anr Chr -DomainController DC01