2012-03-20 15 views
2

すべてのユーザーのすべてのメールボックスとそのサイズをDeparted OUに表示しようとしています。私は非常に近いようですが、私の命令は結果にいくつかのパディングを追加しているようです。メールボックスサイズのOU内のExchangeメールボックスの一覧表示

[PS] C:\Windows\system32>dsquery user "ou=Departed,ou=Staff,dc=COMPANY,dc=local" -limit 4 | dsget user -samid | Get-MailboxStatistics | ft DisplayName, TotalItemSize, ItemCount 

そして出力:

Dsquery has reached the specified limit on number of results to display; use a different value for the -limit option to 
display more results.The specified mailbox " samid     " doesn't exist. 
    + CategoryInfo   : NotSpecified: (0:Int32) [Get-MailboxStatistics], ManagementObjectNotFoundException 
    + FullyQualifiedErrorId : DD7D7CEA,Microsoft.Exchange.Management.MapiTasks.GetMailboxStatistics 

The specified mailbox " Eka.Tian    " doesn't exist. 
    + CategoryInfo   : NotSpecified: (1:Int32) [Get-MailboxStatistics], ManagementObjectNotFoundException 
    + FullyQualifiedErrorId : 7F701DFD,Microsoft.Exchange.Management.MapiTasks.GetMailboxStatistics 

明らかはずの最初の結果のための作品 "samid" ではなく "Eka.Tian" が存在します。なぜそれらすべてのスペースを追加するのですか? Get-MailboxStatisticsでうまくいくように、dsgetユーザーから出力をフォーマットする方法はありますか?

答えて

9

なぜdsqueryですか?

get-mailbox -OrganizationalUnit "ou=Departed,ou=Staff,dc=COMPANY,dc=local" -resultsize unlimited | 
get-mailboxstatistics | ft DisplayName,TotalItemSize,Itemcount 
+0

oh my :) -organizationunitスイッチが表示されませんでした。ありがとうございました! –

関連する問題