检索 Active Directory 计算机描述时遇到问题

Trouble retrieving Active Directory computer description

当我运行:

$computer = Get-ADComputer -SearchBase 'OU="Windows 7 Machines",OU="Devices",dc=blah,dc=Local' -Filter 'name -like "computerName"' -Properties Description

我可以使用

获取广告描述
$computer.Description

我的问题是:如何在不使用 -Properties Description 参数的情况下获取计算机描述?

$computer = Get-ADComputer -SearchBase 'OU="Windows 7 Machines",OU="Devices",dc=blah,dc=Local' -Filter 'name -like "computerName"'

如何从此处的 $computer 变量中获取描述?

使用 Get-ADComputer 或其他一些 LDAP 查询工具?你没有。

指定 -Properties Description 告诉 Get-ADComputer cmdlet 从 LDAP 服务器请求 description 字段。如果您没有特别请求它,LDAP 服务器不会在响应中将它发送回 cmdlet。您必须指定超出默认值的任何您想要的字段,并且说明不是默认字段。

我的意思是当然,好的,你可以说 -Properties *,这在技术上回答了你的问题,但是你要求 每个 属性 (这很糟糕;需要更长的时间)。