gpt4 book ai didi

Powershell:从另一个域获取 ADComputer 返回操作系统信息空白/缺失

转载 作者:行者123 更新时间:2023-12-01 05:00:24 25 4
gpt4 key购买 nike

尝试列出所有计算机及其属于另一个受信任域的操作系统信息,但 OperatingSystem 和 OperatingSystemVersion 返回空值:

Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion -SearchBase "" -Server OtherDomain.com.au:3268 | Format-Table Name, OperatingSystem, OperatingSystemVersion

仅填充 Name 属性。

如果我运行它,它会返回很多信息,但操作系统信息都是空白的:
Get-ADComputer -Filter * -Properties * -SearchBase "" -Server OtherDomain.com.au:3268

如果我在“OtherDomain”上运行这个命令,它工作得很好:
Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion | Format-Table Name, OperatingSystem, OperatingSystemVersion

我得到了我想要的所有 3 个信息。当我从不同的域运行它时,这里是否存在一些安全问题?我可以浏览 Active Directory 用户和计算机 (dsa.msc) 并查看其他域中计算机的操作系统信息也没有问题。

我正在使用 Powershell 3.0

最佳答案

Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion -SearchBase "DC=OtherDomain,DC=com,DC=au" -Server "OtherDomain.com.au" | Format-Table Name, OperatingSystem, OperatingSystemVersion

必须在 Searchbase 参数中包含一个值(cdidn 不适用于空值)并从 Server 参数值中删除端口号。

关于Powershell:从另一个域获取 ADComputer 返回操作系统信息空白/缺失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33498286/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com