Get-Mailbox username
让我举了例如用户的“Displayname”。 Get-MailboxRegionalConfiguration
给了我更多信息。
我想用
PS> Get-Mailbox username | Get-MailboxRegionalConfiguration Identity Language DateFormat TimeFormat TimeZone -------- -------- ---------- ---------- -------- en-US M/d/yyyy h:mm tt W. Europe Standard Time
我还需要来自Displayname
的Get-Mailbox
。我可以用管子做这个吗?
到目前为止,我必须使用foreach并希望避免这种情况:
$MBs = Get-Mailbox -ResultSize Unlimited
foreach ($MB in $MBs) {
$Name = $MB.DisplayName
$MRC = $MB | Get-MailboxRegionalConfiguration
$Lang = $MRC.Language
$DF = $MRC.DateFormat
$TF = $MRC.TimeFormat
$TZ = $MRC.TimeZone
}
您可以执行以下操作来扩展Get-MailboxRegionalConfiguration
中的对象以及其他信息:
Get-Mailbox -ResultSize Unlimited | ForEach-Object {
$name = $_.DisplayName
$_ | Get-MailboxRegionalConfiguration |
Select-Object *,@{n='DisplayName',e={$name}}
}