Powershell: Get-ADComputer from another domain returns OperatingSystem information blank/missing

旧街凉风 提交于 2021-02-16 17:54:05

问题


Trying to list all computers with their OS information that belong to another trusted domain, but OperatingSystem and OperatingSystemVersion returns blank values:

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

Only the Name property is populated.

If I run this, it returns alot of info, but the OS info is all blank:

Get-ADComputer -Filter * -Properties * -SearchBase "" -Server OtherDomain.com.au:3268

If I run this command on the "OtherDomain" it works just fine:

Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion | Format-Table Name, OperatingSystem, OperatingSystemVersion

I get all 3 information I want. Is there some security issue here that I am encountering when I run it from a different domain? I can browse through Active Directory Users and Computers (dsa.msc) and see the OS information of computers in the other domain without a problem too.

I'm using Powershell 3.0


回答1:


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

Had to include a value in the Searchbase parameter (cdidn't work with a null value) and remove the port number from the Server parameter value.



来源:https://stackoverflow.com/questions/33498286/powershell-get-adcomputer-from-another-domain-returns-operatingsystem-informati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!