Get-Contact

 

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

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

使用 Get-Contact 指令程式來擷取指定連絡人的資訊。

語法

Get-Contact [-Identity <ContactIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

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

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

詳細描述

Get-Contact 指令程式會查詢 Active Directory 目錄服務中,特定連絡人或連絡人收件者物件的內容。

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

  • Exchange 僅檢視管理角色

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

參數

參數 必要 類型 描述

Anr

選用

System.String

Anr 參數用來搜尋符合部分所提供字串的物件。與使用萬用字元來搜尋相似。

Credential

選用

System.Management.Automation.PSCredential

Credential 參數可指定用於查詢 Active Directory 中連絡人認證的帳戶。

DomainController

選用

Microsoft.Exchange.Data.Fqdn

若要指定從 Active Directory 擷取資料之網域控制站的網域全名 (FQDN),請在命令中加入 DomainController 參數。

Filter

選用

System.String

Filter 參數可指定用於限制查詢所傳回之收件者的屬性集。

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

Identity

選用

Microsoft.Exchange.Configuration.Tasks.ContactIdParameter

Identity 參數使用下列其中一個值:

  • GUID
  • 辨別名稱 (DN)
  • 網域\帳戶
  • 使用者主要名稱 (UPN)
  • LegacyExchangeDN
  • 簡易郵件傳送通訊協定 (SMTP) 位址
  • 別名

IgnoreDefaultScope

選用

System.Management.Automation.SwitchParameter

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

  • 您無法使用 DomainController 參數。此命令會自動使用適當的通用類別目錄伺服器。
  • 您只可以針對 Identity 參數使用 DN。不接受其他形式的識別碼 (如別名或 GUID)。
  • 您無法同時使用 OrganizationalUnitIdentity 參數。
  • 您無法使用 Credential 參數。

OrganizationalUnit

選用

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

OrganizationalUnit 參數只會傳回指定組織單位 (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 是設定為 ConferenceRoomMailbox,而使用者信箱的 RecipientTypeDetails 則是設定為 UserMailbox。

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

  • Contact
  • MailEnabledContact
  • MailEnabledForestContact

ResultSize

選用

Microsoft.Exchange.Data.Unlimited

ResultSize 參數可指定傳回的結果筆數上限。

SortBy

選用

System.String

SortBy 參數可指定依單一屬性,以遞增順序排序。

輸入類型

傳回類型

錯誤

錯誤 描述

 

 

例外狀況

例外狀況 描述

 

範例

在此範例中,Get-Contact 命令會擷取連絡人 Ted Bremer 並以管線將物件傳輸到 Format-List 命令,以顯示該連絡人的相關資訊。

Get-Contact -Identity TedBremer | Format-List

若要確保您目前閱讀的是最新資訊,並尋找其他的 Exchange Server 2007 說明文件,請造訪 Exchange Server 技術資源中心.