我正在使用 powershell 来提取 Exchange 2003 用户的列表,并基于用户的邮箱“LegacyDN”,我希望使用 LDAP 查询来提取他们的 activesyncenabled 属性(msExchOmaAdminWirelessEnable)、描述和办公室;但是,它似乎并没有出现在我身上。有任何想法吗?
这是我查询 AD 属性的方式:
$allusers = get-wmiobject -class exchange_mailbox -namespace root\microsoftexchangev2 -computername srv02 | select mailboxdisplayname, legacyDN
foreach ($user in $allusers)
{
$obj = new-object psobject
$exchangever = "2003"
$tmp = [adsi]("LDAP://" + $user.legacydn)
$obj | add-member -membertype noteproperty -name "Display Name" -value $user.mailboxdisplayname
$obj | add-member -membertype noteproperty -name "Office" -value $tmp.physicaldeliveryofficename
$obj | add-member -membertype noteproperty -name "Description" -value $tmp.description
$obj | add-member -membertype noteproperty -name "Activesync" -value $tmp.msExchOmaAdminWirelessEnable
$allusersemail += $obj
}
$alluseremail | export-csv \\srv02\logs\test.csv